HomeBrew Mac change Python Path

后端 未结 2 1281
离开以前
离开以前 2021-02-15 13:03

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 ne

相关标签:
2条回答
  • 2021-02-15 13:42

    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.

    0 讨论(0)
  • 2021-02-15 14:05

    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
    
    0 讨论(0)
提交回复
热议问题