Import error in zope.interface.registry in python

I am installing a project in a virtual environment. I get an error

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

The version of this module is as 4.0.5

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

I tried the same thing on my machine (not virtual env),

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

Here from zope.interface.registry import Components did not produce any error. According to this

 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. 

he should not make any mistakes. Any suggestion on what I am missing here or how to solve this error?

+4
source share
1 answer

I had a similar error - I tried to create a new virtual env without package sites. He creates everything perfectly. But my ubuntu already installed zope.interface for its own use, so he didn’t want to install it in addition to my vein.

This collision causes my venv to throw an error in a simple test application in mod_wsgi:

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

So, I'm trying to remove zope.interface from base python. But the unistall command did not delete it (I found on google that this is a known issue).

How did I find a solution: I just switched to my venv and gave the command to "update" zope.interface from there:

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

After that, my problem is with zope.interface dissmiss.

Your problem is similar, so my solution may help. In any case, this answer is very useful for ubuntu desktop users.

+4
source

All Articles