KeyError: 'zope' when starting some Python apps (supervisord, gunicorn, …) -
i'm not sure if issue related supervisord here when try launch it. looks bit issue related python2 itself…
$ supervisord traceback (most recent call last): file "/usr/bin/supervisord", line 5, in <module> pkg_resources import load_entry_point file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2727, in <module> add_activation_listener(lambda dist: dist.activate()) file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 700, in subscribe callback(dist) file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2727, in <lambda> add_activation_listener(lambda dist: dist.activate()) file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2230, in activate map(declare_namespace, self._get_metadata('namespace_packages.txt')) file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1815, in declare_namespace path = sys.modules[parent].__path__ keyerror: 'zope'
my memory might betraying me feel remembering happened me when trying launch program too, don't remember atm. [1]
i use supervisord monitore if 1 process crash , restart automatically, if crashes continuously, gives , have kill supervisord , restart manually. used work not anymore.
edit: [1] happens when try launch gunicorn.
$ /var/www/bin/gunicorn -b 127.0.0.1:5000 index:app traceback (most recent call last): file "/var/www/bin/gunicorn", line 5, in <module> pkg_resources import load_entry_point file "/var/www/lib/python3.3/site-packages/pkg_resources.py", line 3027, in <module> add_activation_listener(lambda dist: dist.activate()) file "/var/www/lib/python3.3/site-packages/pkg_resources.py", line 741, in subscribe callback(dist) file "/var/www/lib/python3.3/site-packages/pkg_resources.py", line 3027, in <lambda> add_activation_listener(lambda dist: dist.activate()) file "/var/www/lib/python3.3/site-packages/pkg_resources.py", line 2514, in activate list(map(declare_namespace, self._get_metadata('namespace_packages.txt'))) file "/var/www/lib/python3.3/site-packages/pkg_resources.py", line 2082, in declare_namespace path = sys.modules[parent].__path__ keyerror: 'zope'
edit 2: seems linked issue: https://bugs.launchpad.net/ubuntu/+source/zope.app.pagetemplate/+bug/851038 … i'm not sure it. edit edit: maybe not, 4y old.
yes use ubuntu server well.
based on long discussion in chat, problem you've messed env in such way python installations on system getting confused.
your .bashrc
file contains line export pythonpath=/usr/local/lib/python3.3/dist-packages/
. however, all pythons use path, python 2.
you installed supervisor , gunicorn apt, , these versions use python2. when run gunicorn
, command uses python2, picks pythonpath python 3 specific stuff on it. along line tries inspect path , gets confused somehow.
remove line in .bashrc
file modifying pythonpath.
Comments
Post a Comment