Aesir
Aesir

Reputation: 2473

Installing ipython qtconsole mac osx - can't find pyqt on system

I have followed the following steps in order to set up a data science environment on my laptop, running osx yosemite 10.10.3.

When I enter the suggested command at the end of the guide "ipython qtconsole" I get an error message which suggests that pyqt is not installed / it does not exist where it is currently looking for it:

" ImportError: Could not load requested Qt binding. Please ensure that PyQt4 >= 4.7, PyQt5 or PySide >= 1.0.3 is available, and only one is imported per session.

Currently-imported Qt library:   None
PyQt4 installed:                 False
PyQt5 installed:                 False
PySide >= 1.0.3 installed:       False
Tried to load:                   ['pyside', 'pyqt', 'pyqt5']"

I have however installed these formulas using brew:

brew install qt
brew install sip
brew install pyqt

and have confirmed that they now are installed by running the command

brew list

and confirmed that they are in the outputted list. So I should have a version of pyqt installed. After installing pyqt I got the following message output:

==> Caveats Phonon support is broken.

Python modules have been installed and Homebrew's site-packages is not in your Python sys.path, so you will not be able to import the modules this formula installed. If you plan to develop with these modules, please run:

mkdir -p 
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> homebrew.pth

which I did.

So I am not sure how to proceed, I need to tell ipython where the location of pyqt is on my system I assume, but not sure how to do this.

Upvotes: 2

Views: 2340

Answers (2)

crock1255
crock1255

Reputation: 1085

I was having the same exact problem. This solved it: past export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH in the terminal to link your brewed packages with your OS.

Upvotes: 1

Oplatek
Oplatek

Reputation: 358

I added two more steps and I am happily using the qtconsole.

sudo pip install pyside
pyside_postinstall.py -install

It worked for me on OSX 10.10.

Source: The PySide module docs docs

Upvotes: 1

Related Questions