我正在尝试在我的 Raspberry Pi 型号 4 上安装 PySide2。
我尝试了以下操作:
$ pip3 install pyside2
结果:
<块引用>Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pyside2
Could not find a version that satisfies the requirement pyside2 (from versions: )
No matching distribution found for pyside2
然后我尝试了一种我在另一个帖子中看到的方法:
sudo apt-get install python3-pyside2.qt3dcore python3-pyside2.qt3dinput python3-pyside2.qt3dlogic python3-pyside2.qt3drender python3-pyside2.qtcharts python3-pyside2.qtconcurrent python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qthelp python3-pyside2.qtlocation python3-pyside2.qtmultimedia python3-pyside2.qtmultimediawidgets python3-pyside2.qtnetwork python3-pyside2.qtopengl python3-pyside2.qtpositioning python3-pyside2.qtprintsupport python3-pyside2.qtqml python3-pyside2.qtquick python3-pyside2.qtquickwidgets python3-pyside2.qtscript python3-pyside2.qtscripttools python3-pyside2.qtsensors python3-pyside2.qtsql python3-pyside2.qtsvg python3-pyside2.qttest python3-pyside2.qttexttospeech python3-pyside2.qtuitools python3-pyside2.qtwebchannel python3-pyside2.qtwebsockets python3-pyside2.qtwidgets python3-pyside2.qtx11extras python3-pyside2.qtxml python3-pyside2.qtxmlpatterns python3-pyside2uic
这似乎成功安装了 PySide2。重新输入此命令确认这些模块已经是“最新版本”。但是,我使用以下方法在已安装的软件包列表中找不到它:
$ pip3 list
当我尝试导入库时,python 也无法识别该包。有没有人可以解决这个问题?
答案 0 :(得分:0)
我发现我的 Python 3 dist-packages 目录没有添加到 PATH。 为了解决这个问题,我在终端中输入了以下命令:
PYTHONPATH="/usr/local/lib/python2.6/site-packages/":"${PYTHONPATH}"
export PYTHONPATH
我还添加了以下路径以防万一(我对此很陌生):
export PATH=$PATH:/usr/local/lib/python3.7/dist-packages/site.py
在那之后,
import PySide2
变得实用。