Trying_hard
Trying_hard

Reputation: 9501

HomeBrew Mac change Python Path

I am trying to install PyQT and I used PyQT. Is has been installed using home brew. But When I try to import it, python can't. I get the following warning in Home brew. I am new to Mac and can't figure out how to change the python path. Any help would be great.

For non-homebrew python (2.x), you need to amend your PYTHONPATH like so: export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

Upvotes: 8

Views: 18595

Answers (2)

Minh Nguyen
Minh Nguyen

Reputation: 330

Since you installed PyQt by using Homebrew, you should also use Homebrew Python 2.

To install it, run: brew install python

Now, you can import PyQt normally.

Upvotes: 0

mipadi
mipadi

Reputation: 411192

You should edit ~/.bash_profile (create the file if it does not exist) to set the PYTHONPATH environment variable:

export PYTHONPATH=`brew --prefix`/lib/python2.7/site-packages:$PYTHONPATH

Upvotes: 15

Related Questions