I have managed to get spyder installed and functioning on my mac but I want to add in a few modules that it doesn't include by default (mahotas and pymorph).
I installed both via easy_install in the terminal and both seemed to install without any error messages. Running python from a terminal and using import mahotas and import pymorph works just fine without error messages. However, when I run the same lines from a script within spyder I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 493, in runfile
execfile(filename, namespace)
File "/Users/Name/Documents/Python/dna.py", line 11, in <module>
import pymorph
ImportError: No module named pymorph
All I'm trying to do right now is run the import lines, that's it. I can't seem to find anything about this. I'm guessing that spyder uses a separate install of python and that installing modules via the terminal installs them only to the system version of python. How do I add them to spyder?
Specs:
Mac OSX 10.7.4
Spyder 2.1.9
Ok, no one has answered this yet but I managed to figure it out and get it working after also posting on the spyder discussion boards. For any libraries that you want to add that aren't included in the default search path of spyder, you need to go into Tools and add a path to each library via the PYTHONPATH manager. You'll then need to update the module names list from the same menu and restart spyder before the changes take effect.
Thanks - worked for me. But also, you don't need to restart Spyder, just close the interpreter, then right-click and "open interpreter" to restart the python interpreter. The new path is used.
Once you implement this solution it appears that anything calling the ibpy EReader file may fail on line 29 with
SyntaxError: cannot assign to None
. If your getting this remove or comment outNone
. ReferenceUnder menu Spyder/PYTONPATH Manager
After adding paths via spyder's pythonpath manager, restarting anaconda was necessary in my case.
This did not work for me on Windows. I had to manually add the package folder to the
PATH
variable and notPYTHONPATH
variable