Fix PySide 导入问题 No module named ‘PySide‘

遇到的问题

本文基于python3.6

from PySide.QtCore import QThread
ModuleNotFoundError: No module named 'PySide'

分析1
···

pip install pyqt5
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: pyqt5 in c:\users\tony\pycharmprojects\pythonproject1\venv\lib\site-packages (5.15.4)
Requirement already satisfied: PyQt5-sip<13,>=12.8 in c:\users\tony\pycharmprojects\pythonproject1\venv\lib\site-packages (from pyqt5) (12.9.0)
Requirement already satisfied: PyQt5-Qt5>=5.15 in c:\users\tony\pycharmprojects\pythonproject1\venv\lib\site-packages (from pyqt5) (5.15.2)
···
结论 不行
分析2
···
pip install PySide
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting PySide
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/36/ac/ca31db6f2225844d37a41b10615c3d371587677efd074db29855e7035de6/PySide-1.2.4.tar.gz (9.3 MB)
|████████████████████████████████| 9.3 MB 1.1 MB/s
ERROR: Command errored out with exit status 1:
command: ‘c:\users\tony\pycharmprojects\pythonproject1\venv\scripts\python.exe’ -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\tony\AppData\Local\Temp\pip-install-ut3flpv2\pyside_97191846f6b348
4e950db4f0c7c07183\setup.py’"’"’; file=’"’"‘C:\Users\tony\AppData\Local\Temp\pip-install-ut3flpv2\pyside_97191846f6b3484e950db4f0c7c07183\setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file) if os.path.ex
ists(file) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ egg_info --egg-base ‘C:\Users\tony\AppDa
ta\Local\Temp\pip-pip-egg-info-yq4uvzn6’
cwd: C:\Users\tony\AppData\Local\Temp\pip-install-ut3flpv2\pyside_97191846f6b3484e950db4f0c7c07183
Complete output (1 lines):
only these python versions are supported: [(2, 6), (2, 7), (3, 2), (3, 3), (3, 4)]
----------------------------------------

···
结论: 不行
分析3

>pip install python3-pyside
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
ERROR: Could not find a version that satisfies the requirement python3-pyside (from versions: none)
ERROR: No matching distribution found for python3-pyside

结论: 不行
分析4

>pip install pyside2
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pyside2
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/81/73/830023aa8f06d9b04bf45146fd95f1a0f8644f196713fe98bc678e35ab6c/PySide2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl (136.3 MB)
     |████████████████████████████████| 136.3 MB 35 kB/s
Collecting shiboken2==5.15.2
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/85/c2/49578ee1912e06e4f4ffb2cf974b4ee864f6d81bcb3961bc8b96de021cbd/shiboken2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl (2.3 MB)
     |████████████████████████████████| 2.3 MB 1.1 MB/s
Installing collected packages: shiboken2, pyside2
Successfully installed pyside2-5.15.2 shiboken2-5.15.2

结论 不行:
分析5

#from PySide.QtCore import QThread
#from PySide.QtCore import Signal
from PyQt5.QtCore import QThread
from PyQt5.QtCore import pyqtSignal

结论 :可以替代

总结

QT在python3.6使用中 使用pyqt5模块
进一步确认正在进行中

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值