新服务器环境部署基本完成了,但是在服务启动的时候出现了下面的错误:pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
完整错误信息:
lighthouse@VM-16-8-ubuntu:~/da-yi-ma-hou-tai$ gunicorn dayima_backend.wsgi:application --workers=4 --worker-class=gevent --bind=0.0.0.0:10086 [2024-02-27 15:08:15 +0800] [1631289] [INFO] Starting gunicorn 21.2.0 [2024-02-27 15:08:15 +0800] [1631289] [INFO] Listening at: http://0.0.0.0:10086 (1631289) [2024-02-27 15:08:15 +0800] [1631289] [INFO] Using worker: gevent [2024-02-27 15:08:15 +0800] [1631295] [INFO] Booting worker with pid: 1631295 [2024-02-27 15:08:15 +0800] [1631296] [INFO] Booting worker with pid: 1631296 [2024-02-27 15:08:15 +0800] [1631297] [INFO] Booting worker with pid: 1631297 [2024-02-27 15:08:15 +0800] [1631298] [INFO] Booting worker with pid: 1631298 /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release warnings.warn( /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release warnings.warn( /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release warnings.warn( /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release warnings.warn( /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release warnings.warn( /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release warnings.warn( /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release warnings.warn( /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release warnings.warn(
搜索了一下,百度没找到什么有用的信息,于是饭前 google 了一下,发现了这个帖子:
https://askubuntu.com/questions/1406952/what-is-the-meaning-of-this-pkgresourcesdeprecationwarning-warning-from-pipenv
setuptools 的 bug,通过下面的命令降级即可:
pip install --upgrade --user setuptools==58.3.0
再次运行就 ok 了:
The post Python 3. 10. 12 PkgResourcesDeprecationWarning first appeared on obaby@mars.