我在使用 flask 和 gunicorn 在服务器部署一个服务的时候,出现了这个问题
ubu*********$ python -V
Python 3.6.5 :: Anaconda, Inc.
ubuntu@ip:~***********r$ gunicorn -c gunicorn.conf app:app
Error: class uri 'gevent' invalid or not found:
[Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 143, in load_class
mod = import_module('.'.join(components))
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 22, in <module>
raise RuntimeError("You need gevent installed to use this worker.")
RuntimeError: You need gevent installed to use this worker.
]
我在本地运行是没有问题的,本地有创建虚拟环境,但是服务器上没有创建虚拟环境,我认为跟这个有关系,但是其他的都是在 python3 下运行的,为什么这个会去找 python2 呢,我在 python3 下已经安装了各个依赖