今天在一台新的机子上运行guicorn的时候报了一个错
Error: class uri 'gunicorn.workers.gthread.ThreadWorker' invalid or not found:
[Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 135, 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/local/lib/python2.7/dist-packages/gunicorn/workers/gthread.py", line 37, in <module>
""")
RuntimeError:
You need to install the 'futures' package to use this worker with this
Python version.
]
上面显示说需要安装futures包,于是
pip install futures
pip3 install futures
然而都显示说这个包已经安装了
google了一下,gunicorn的原作者两年前说这个问题已经修复了,但是我看了一下,我的gunicorn是最新版的没错,又看了一下报错信息,显示错误来自python2.7里面的gunicorn包,于是我又试了一下
pip uninstall gunicorn
pip3 install guncorn
再运行,报错消失