HomeBrew Mac Changes Python Path

I am trying to install PyQT and I used PyQT. Is was installed using home brew. But when I try to import it, python cannot. The following warning appears 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-homegrown python (2.x) you need to change PYTHONPATH as follows: export PYTHONPATH = / usr / local / lib / python2.7 / site-packages: $ PYTHONPATH

+7
source share
2 answers

You must 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 
+14
source

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

To install it, run: brew install python

Now you can import PyQt normally.

0
source

All Articles