gevent无效运行Dockerregistry
我正尝试使用以下命令在Ubuntu 14上运行Dockerregistry:
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
我做了一些search,发现了一些告诉我要安装python-gevent以获得gevent的东西:
sudo apt-get install python-gevent
我做了这个和后续调用dpkg:
dpkg -l|grep python
显示安装了python-gevent。
不幸的是,安装还没有解决问题。 我仍然收到同样的失败消息,说gevent是无效的或找不到。
有谁知道如何解决这个问题? 请指教…
尝试一下:
1.find你的python gevent包文件夹:
$ cd /usr/local/lib/python2.7/dist-packages/gevent
2.更新ssl.py
从:
def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
至:
def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
再次尝试:
$sudo gunicorn --access-logfile - --debug -k gevent -b 0.0.0.0:5000 -w 1 docker_registry.wsgi:application
重新安装python-gevent
apt-get install python-gevent
pip安装 – 升级gevent