Reputation: 11
I wrote my own module for Aanaconda and placed it into the correct site-package for Anaconda.
The issue I'm having is that Python says the module does not exist even though its saved in site-packages.
So how do I make /anaconda/lib/python2.7/site-packages find my module?
Upvotes: 1
Views: 695
Reputation: 5935
Perhaps your module isn't built correctly? Or you are using a different python than the one where you put your module?
Let's confirm the site-packages (and the python). In your python interpreter do:
import site
site.getsitepackages()
Did that return ['/anaconda/lib/python2.7/site-packages', '/anaconda/lib/site-python']
? If it returned a different site-packages folder then put your module there. Perhaps you are using a different python (confirm with which python
).
If that looked fine then I would check on your module. Are you sure you have the __init__.py
defined? What error did you get?
Try creating a simple test module like:
simple_test/
|-- __init__.py
`-- simple.py
Where simple.py
just has:
def print_hello():
print("hello")
Now copy the whole of simple_test
directory into the site-packages directory that we discovered above. Now do, in the python interpreter, the following:
from simple_test.simple import print_hello
print_hello()
That should work and give a blueprint for how to do this setup.
FYI long term you should probably be building conda packages and installing them instead of doing this copying work.
Upvotes: 1