5

仮想環境にプロジェクトをインストールしています。エラーが発生しています

from zope.interface.registry import Components
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: No module named registry

このモジュールのバージョン 4.0.5

>>> import pkg_resources
>>> pkg_resources.get_distribution("zope.interface").version
'4.0.5'

私は自分のマシン(仮想環境ではない)で同じことを試しましたが、

>>> import pkg_resources
>>> pkg_resources.get_distribution("zope.interface").version
'4.0.1'
>>> from zope.interface.registry import Components

ここでfrom zope.interface.registry import Componentsはエラーは発生しませんでした。これによると

QUOTE: 3.8.0 (2011-09-22) 
New module zope.interface.registry. This is code moved from 
zope.component.registry which implements a basic nonperistent component registry 
as zope.interface.registry.Components.

、エラーは発生しません。ここで欠けているもの、またはこのエラーを解決する方法について何か提案はありますか?

4

1 に答える 1

4

I had similar error - I tryed to create new virtual env without site-packages. It creates all fine. But my ubuntu has already installed zope.interface for own use, so it did not want to install it additional to my venv.

This collision cause my venv to throw error in simple test app under mod_wsgi:

     from zope.interface.registry import Components
ImportError: No module named registry

So I trying to remove zope.interface from base python. But unistall command not removed it(i found in google, that it is known problem).

Than i found solution: I just switched to my venv and give command for "upgrading" zope.interface from there:

(env)user@ubuntu:~/env$ sudo pip install --upgrade zope.interface

After this my problem with zope.interface dissmiss.

Your problem is similar, so my solution could help. Anyway this answer is very useful for ubuntu desktop users.

于 2014-04-14T22:27:14.073 に答える