我正在尝试使用以下命令在 Ubuntu 14 上运行 Docker 注册表:
sudo gunicorn --access-logfile - --debug -k gevent -b 0.0.0.0:5000 -w 1 docker_registry.wsgi:application
不幸的是,当我尝试这样做时,我收到以下失败消息:
Error: class uri 'gevent' invalid or not found:
[Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 139, 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/ggevent.py", line 24, in <module>
from gevent.server import StreamServer
File "/usr/local/lib/python2.7/dist-packages/gevent/server.py", line 6, in <module>
from gevent.socket import EWOULDBLOCK, socket
File "/usr/local/lib/python2.7/dist-packages/gevent/socket.py", line 659, in <module>
from gevent.ssl import sslwrap_simple as ssl, SSLError as sslerror, SSLSocket as SSLType
File "/usr/local/lib/python2.7/dist-packages/gevent/ssl.py", line 386, in <module>
def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
NameError: name 'PROTOCOL_SSLv3' is not defined
我做了一些搜索并发现了一些告诉我安装 python-gevent 以获得 gevent 的东西:
sudo apt-get install python-gevent
我这样做了,随后调用了 dpkg:
dpkg -l|grep python
显示安装了 python-gevent。
不幸的是,安装并没有解决问题。我仍然收到相同的失败消息,说 gevent 无效或找不到。
有谁知道如何解决这个问题???请指教...
最佳答案
重新安装 python-gevent
apt-get 安装 python-gevent
pip install --upgrade gevent
关于python - gevent 运行 Docker Registry 无效,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34314222/