7

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

When Homebrew install a package, it instals it in the /usr/local/lib... directory, which is not avalaible to add using the Python Path manager of Spyder.The entire directory /usr/... is hidden.

The only relevant similar case I found online was the following: Adding a module (Specifically pymorph) to Spyder (Python IDE)

I have tried unsuccessfuly their recommendations. So two related questions to tackle the problem:

1- would it be possible to actually use in Spyder the same python as the one accessed in the terminal?

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

Thanks

Community
  • 1
  • 1
Simon
  • 1,640
  • 3
  • 16
  • 20

1 Answers1

5

I don't use a mac, but I would go with option 1, building and installing Spyder on your regular Python. Install PyQt4 if you don't have it:
brew install pyqt
Then download the Spyder 2.2.5 source (spyder-2.2.5.zip) from here, unzip the folder where you like. Then open a terminal, and go inside the Spyder source folder (you must input the next commands from inside this folder). Then build using your regular python executable:
python setup.py build
and install:
python setup.py install

If all dependencies are met, you should then have Spyder as a package under your main Python installation. There should be a script to execute it under the Scripts folder.

You can also see "Install or run directly from source" from the main Spyder installation page.

Roberto
  • 2,555
  • 15
  • 30
  • Thanks Roberto. I have followed successfully your steps, however when I launch Spyder, it asks for pyqt which I installed through homebrew. I imagine the spyder.exe uses the python installed natively in MacOS and not the homebrew version which has the pyqt module... – Simon Apr 06 '14 at 00:44
  • I saw your post on Spyder's Issues page :) – Roberto Apr 07 '14 at 13:44