How to make python spyder recognize external packages on MacOS X?

I have spyderlib installed on my MacOS X (10.6.8) using the official dmg file. In parallel, I installed packages using both pip and homebrew from the terminal (i.e. opencv, gdal ...). Since Spyder uses its own version of python, I cannot access my external packages in Spyder.

When Homebrew installs the package, it installs it in the / usr / local / lib ... directory, which is not available for addition using the Python Path Manager for Spyder. The entire / usr / ... directory is hidden.

The only relevant similar case that I found on the Internet was the following: Adding a module (specifically pymorph) to Spyder (Python IDE)

I tried their recommendations unsuccessfully. So, two related questions to solve the problem:

1- is it possible to actually use the same python in Spyder as the one that was available in the terminal?

2- otherwise, how to add external packages to the original Spyder python when the packages are installed in the / usr / local ... folder?

thanks

+7
python homebrew spyder
source share
1 answer

I do not use mac, but I would go with option 1 by creating and installing Spyder on your regular Python. Install PyQt4 if you do not have it:
brew install pyqt
Then download the source of Spyder 2.2.5 (spyder-2.2.5.zip) from here , unzip the folder where you want. Then open the terminal and go to the original Spyder folder (you must enter the following commands from this folder). Then create using a regular python executable:
python setup.py build
and install:
python setup.py install

If all the dependencies are met, you should have Spyder as a package under your main Python installation. To execute it, there must be a script in the Scripts folder.

You can also see "Install or Run Directly from Source" from the Spyder homepage.

+5
source share

All Articles