I am pretty new to python and I am trying to import a module while using a virtualenv.
When I import the module I get:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.6\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: No module named zope.interface
I am trying to import the zope.interface module with line:
import zope.interface
I have double check that this module is installed by calling “pip freeze”. I have also found the location of the module in my virtualEnv site-packages directoy. The path to the modules is:
virName\Lib\site-packages\zope\interface
inside this directory I can see the __init__.py file.
It was my understanding that the presence of the __init__.py file alone would make this a valid module?
I double checked the search path for my module by doing sys.path and It did contain the directory “virName\Lib\site-packages\”
So my question is this. Why is python saying it can’t find the module?
What else do I need to check for?
I have also tried find the modules using:
imp.find_module('zope.interface')
but i get:
Traceback (most recent call last):
File "<input>", line 1, in <module>
ImportError: No module named zope.interface
Try
from a command line prompt from a directory with the pip.exe, such as
I had the same issue and it got resolved after installing as above