新服务器环境部署基本完成了,但是在服务启动的时候出现了下面的错误: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 了:
8 comments
咋没用docker呀,这样迁移就不用考虑环境了😄
后面需要用 crontab 执行一些定时任务,放 docker 里面反而不好做任务管理了。
Python 版本不是越高越好 很多库跟不上版本
并不是,相反很多项目反而依赖于低版本 例如 faceswap,stable diffusion之类的基于的python版本都不同,一般情况下我会用conda或者venv创建虚拟环境以支持多个不同版本的python。
这个是生产环境一般就部署这一个项目,其他的也不会再往上部署了所有没有使用虚拟环境部署。
哈哈哈哈你理解错了,我的意思是:Python 版本,不是越高越好
这,哈哈哈。是着个 意思
Perfect!虽然插不上话,但不影响不了发表言论 哈哈
嗯嗯