Python3 无法找到并导入 PyQt5



i用啤酒安装了pyqt5,似乎最终可以正确地安装过程。

$ brew install pyqt5 --with-python3

问题是我无法导入它:

Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'PyQt5'

我应该从哪里开始寻找为什么它不起作用?我认为它会使用我使用的Brew Commmand自动将其添加到Python中。

可能的解决方案是使用:

找到安装路径
brew info pyqt5

然后将其添加到您的Python路径中,您可以在此处找到解决方案:

永久将目录添加到pythonpath

您的问题也类似于这个

Homebrew Mac Change Python Path

最新更新