我正在尝试在具有jesse的Raspberry Pi上运行一个小的PyQt应用程序,但无法将PyQt5模块导入Python 3.6中
pi@raspberrypi:~ $ cat /etc/debian_version
8.0
pi@raspberrypi:~ $ python3 --version
Python 3.6.5
pi@raspberrypi:~ $ sudo apt-get install python3-pyqt5
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pyqt5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
pi@raspberrypi:~ $ sudo apt-get install pyqt5-dev-tools qttools5-dev-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
pyqt5-dev-tools is already the newest version.
qttools5-dev-tools is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
pi@raspberrypi:~ $ python3
Python 3.6.5 (default, Jul 4 2019, 01:11:28)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5 import QtCore
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyQt5'
>>>
我的导入语句是否错误?包裹还有别的名字吗?
答案 0 :(得分:0)
否,您的导入语句没有错。不,(apt
或pip
)包未命名。但是,Python 3.6.5不是Python 3 version that shipped with Debian Jessie,而是Python 3.4.2。