我的代码
import sys
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
conda install pyqt -y
(wzry38) C:\Users\ntbgy>pip show pyqt5
Name: PyQt5
Version: 5.14.2
Summary: Python bindings for the Qt cross platform application toolkit
Home-page: https://www.riverbankcomputing.com/software/pyqt/
Author: Riverbank Computing Limited
Author-email: info@riverbankcomputing.com
License: GPL v3
Location: c:\users\ntbgy\.conda\envs\wzry38\lib\site-packages
Requires: PyQt5-sip
Required-by: pyqt5-plugins, pyqt5-tools
(wzry38) C:\Users\ntbgy>pip show pyqt5-plugins
Name: pyqt5-plugins
Version: 5.14.2.1
Summary: PyQt Designer and QML plugins
Home-page: https://github.com/altendky/pyqt5-tools
Author: Kyle Altendorf
Author-email: sda@fstab.net
License: GPLv3
Location: c:\users\ntbgy\.conda\envs\wzry38\lib\site-packages
Requires: click, pyqt5, qt5-applications
Required-by: pyqt5-tools
(wzry38) C:\Users\ntbgy>pip show pyqt5-tools
Name: pyqt5-tools
Version: 5.14.2.2
Summary: PyQt Designer and QML plugins
Home-page: https://github.com/altendky/pyqt5-tools
Author: Kyle Altendorf
Author-email: sda@fstab.net
License: GPLv3
Location: c:\users\ntbgy\.conda\envs\wzry38\lib\site-packages
Requires: click, pyqt5, pyqt5-plugins, python-dotenv
Required-by:
(wzry38) C:\Users\ntbgy>echo %QT_QPA_PLATFORM_PLUGIN_PATH%
C:\Users\ntbgy\.conda\envs\wzry38\Lib\site-packages\PyQt5\Qt5\plugins\platforms
网上的办法找完了,还是不能运行。
重新整个干净虚拟环境,代码可以运行了,奇怪,原环境什么影响了它呢?
conda create -n wzry38_2 python=3.8 -y
conda activate wzry38_2
conda install pyqt -y
conda deactivate
原环境已安装信息
(wzry38) C:\Users\ntbgy>pip list
Package Version
---------------------------------------- -----------
accelerate 0.33.0
aiofiles 23.2.1
aiohappyeyeballs 2.3.5
aiohttp 3.10.3
aiosignal 1.3.1
airtest 1.3.4
annotated-types 0.7.0
anyio 4.4.0
asgiref 3.8.1
astor 0.8.1
async-timeout 4.0.3
attrs 24.2.0
backoff 2.2.1
bcrypt 4.2.0
beautifulsoup4 4.12.3
build 1.2.1
cached-property 1.5.2
cachetools 5.4.0
certifi 2024.7.4
charset-normalizer 3.3.2
chroma-hnswlib 0.7.6
chromadb 0.5.5
click 8.1.7
colorama 0.4.6
colored 1.4.4
coloredlogs 15.0.1
comtypes 1.4.6
construct 2.10.70
contourpy 1.1.1
coverage 5.5
cpm-kernels 1.0.11
cycler 0.12.1
Cython 3.0.11
dataclasses-json 0.6.7
decorator 5.1.1
Deprecated 1.2.14
deprecation 2.1.0
dirtyjson 1.0.8
distro 1.9.0
exceptiongroup 1.2.2
eyed3 0.9.7
facebook-wda 1.4.9
fastapi 0.112.0
ffmpeg-python 0.2.0
ffmpy 0.4.0
filelock 3.15.4
filetype 1.2.0
fire 0.6.0
flatbuffers 24.3.25
fonttools 4.53.1
frozenlist 1.4.1
fsspec 2024.6.1
future 1.0.0
google-auth 2.33.0
googleapis-common-protos 1.63.2
gradio 4.41.0
gradio_client 1.3.0
graphlib_backport 1.1.0
greenlet 3.0.3
grpcio 1.65.4
h11 0.14.0
httpcore 1.0.5
httptools 0.6.1
httpx 0.27.0
huggingface-hub 0.24.5
humanfriendly 10.0
idna 3.7
imageio 2.34.2
imgaug 0.4.0
importlib_metadata 8.0.0
importlib_resources 6.4.0
intel-openmp 2021.4.0
Jinja2 3.1.4
jiter 0.5.0
joblib 1.4.2
jsonpatch 1.33
jsonpointer 3.0.0
kiwisolver 1.4.5
kubernetes 30.1.0
latex2mathml 3.77.0
lazy_loader 0.4
llama-cloud 0.0.13
llama-index 0.10.64
llama-index-agent-openai 0.2.9
llama-index-cli 0.1.13
llama-index-core 0.10.64
llama-index-embeddings-openai 0.1.11
llama-index-indices-managed-llama-cloud 0.2.7
llama-index-legacy 0.9.48
llama-index-llms-openai 0.1.29
llama-index-multi-modal-llms-openai 0.1.9
llama-index-program-openai 0.1.7
llama-index-question-gen-openai 0.1.3
llama-index-readers-file 0.1.33
llama-index-readers-llama-parse 0.1.6
llama-index-vector-stores-chroma 0.1.10
llama-parse 0.4.9
lmdb 1.5.1
loguru 0.7.2
logzero 1.7.0
lxml 5.3.0
Markdown 3.7
markdown-it-py 3.0.0
MarkupSafe 2.1.5
marshmallow 3.21.3
matplotlib 3.7.5
mdtex2html 1.3.0
mdurl 0.1.2
mkl 2021.4.0
mmh3 4.1.0
modelscope 1.17.1
monotonic 1.6
MouseInfo 0.1.3
mpmath 1.3.0
mss 6.1.0
multidict 6.0.5
mutagen 1.47.0
mypy-extensions 1.0.0
mysql-connector-python 9.0.0
nest-asyncio 1.6.0
networkx 3.1
nltk 3.8.1
numpy 1.24.4
oauthlib 3.2.2
ollama 0.3.1
onnxruntime 1.18.1
openai 1.40.6
opencv-contrib-python 4.6.0.66
opencv-python 4.10.0.84
opentelemetry-api 1.26.0
opentelemetry-exporter-otlp-proto-common 1.26.0
opentelemetry-exporter-otlp-proto-grpc 1.26.0
opentelemetry-instrumentation 0.47b0
opentelemetry-instrumentation-asgi 0.47b0
opentelemetry-instrumentation-fastapi 0.47b0
opentelemetry-proto 1.26.0
opentelemetry-sdk 1.26.0
opentelemetry-semantic-conventions 0.47b0
opentelemetry-util-http 0.47b0
opt-einsum 3.3.0
orjson 3.10.7
overrides 7.7.0
packaging 24.1
paddleocr 2.8.1
paddlepaddle 2.6.1
pandas 2.0.3
pillow 10.4.0
pip 24.2
ply 3.11
posthog 3.5.0
protobuf 3.20.2
psutil 6.0.0
py 1.11.0
py-cpuinfo 9.0.0
pyasn1 0.6.0
pyasn1_modules 0.4.0
PyAutoGUI 0.9.54
pyclipper 1.3.0.post5
pydantic 2.8.2
pydantic_core 2.20.1
pydub 0.25.1
PyGetWindow 0.0.9
Pygments 2.18.0
pyminitouch 0.3.3
PyMsgBox 1.0.9
pynput 1.7.7
pyparsing 3.1.2
pypdf 4.3.1
pyperclip 1.9.0
PyPika 0.48.9
pypiwin32 223
pyproject_hooks 1.1.0
PyQt5 5.14.2
pyqt5-plugins 5.14.2.1
PyQt5-Qt5 5.15.2
PyQt5-sip 12.12.2
pyqt5-tools 5.14.2.2
pyreadline3 3.4.1
PyRect 0.2.0
PyScreeze 0.1.30
python-dateutil 2.9.0.post0
python-docx 1.1.2
python-dotenv 1.0.1
python-multipart 0.0.9
python-qt5 0.1.10
pytweening 1.2.0
pytz 2024.1
PyWavelets 1.4.1
pywin32 306
pywinauto 0.6.3
PyYAML 6.0.2
qt5-applications 5.14.2.1
qt5-tools 5.15.2.1.3
rapidfuzz 3.9.6
regex 2024.7.24
requests 2.32.3
requests-oauthlib 2.0.0
retry 0.9.2
rich 13.7.1
rsa 4.9
ruff 0.6.1
safetensors 0.4.4
scikit-image 0.21.0
scipy 1.10.1
seaborn 0.13.2
semantic-version 2.10.0
sentencepiece 0.2.0
setuptools 73.0.1
shapely 2.0.5
shellingham 1.5.4
simple-tornado 0.2.2
simplejson 3.19.2
sip 6.7.12
six 1.16.0
sniffio 1.3.1
soupsieve 2.5
spark-ai-python 0.4.1
sparkai 0.3.0
SQLAlchemy 2.0.32
starlette 0.37.2
striprtf 0.0.26
sympy 1.13.2
tabulate 0.9.0
tbb 2021.13.1
tenacity 8.5.0
termcolor 2.4.0
tidevice 0.12.10
tifffile 2023.7.10
tiktoken 0.7.0
tokenizers 0.19.1
toml 0.10.2
tomli 2.0.1
tomlkit 0.12.0
torch 2.0.0+cu118
torchaudio 2.0.1
torchdata 0.6.0
torchtext 0.15.0
torchvision 0.15.1
tornado 6.4.1
tqdm 4.66.5
transformers 4.44.0
typer 0.12.3
typing_extensions 4.12.2
typing-inspect 0.9.0
tzdata 2024.1
ultralytics 8.2.90
ultralytics-thop 2.0.6
urllib3 2.2.2
uvicorn 0.30.6
volcengine-python-sdk 1.0.95
watchfiles 0.23.0
websocket-client 1.8.0
websockets 12.0
wheel 0.44.0
win32-setctime 1.1.0
wrapt 1.16.0
yarl 1.9.4
zipp 3.20.0
(wzry38) C:\Users\ntbgy>
新环境,干净的安装信息。
(wzry38_2) C:\Users\ntbgy>pip list
Package Version
---------------------------------------- -----------
accelerate 0.33.0
aiofiles 23.2.1
aiohappyeyeballs 2.3.5
aiohttp 3.10.3
aiosignal 1.3.1
airtest 1.3.4
annotated-types 0.7.0
anyio 4.4.0
asgiref 3.8.1
async-timeout 4.0.3
attrs 24.2.0
backoff 2.2.1
bcrypt 4.2.0
beautifulsoup4 4.12.3
build 1.2.1
cached-property 1.5.2
cachetools 5.4.0
certifi 2024.7.4
charset-normalizer 3.3.2
chroma-hnswlib 0.7.6
chromadb 0.5.5
click 8.1.7
colorama 0.4.6
colored 1.4.4
coloredlogs 15.0.1
comtypes 1.4.6
construct 2.10.70
contourpy 1.1.1
coverage 5.5
cpm-kernels 1.0.11
cycler 0.12.1
Cython 3.0.11
dataclasses-json 0.6.7
decorator 5.1.1
Deprecated 1.2.14
deprecation 2.1.0
dirtyjson 1.0.8
distro 1.9.0
exceptiongroup 1.2.2
eyed3 0.9.7
facebook-wda 1.4.9
fastapi 0.112.0
ffmpeg-python 0.2.0
ffmpy 0.4.0
filelock 3.15.4
filetype 1.2.0
fire 0.6.0
flatbuffers 24.3.25
fonttools 4.53.1
frozenlist 1.4.1
fsspec 2024.6.1
future 1.0.0
google-auth 2.33.0
googleapis-common-protos 1.63.2
gradio 4.41.0
gradio_client 1.3.0
graphlib_backport 1.1.0
greenlet 3.0.3
grpcio 1.65.4
h11 0.14.0
httpcore 1.0.5
httptools 0.6.1
httpx 0.27.0
huggingface-hub 0.24.5
humanfriendly 10.0
idna 3.7
imageio 2.34.2
imgaug 0.4.0
importlib_metadata 8.0.0
importlib_resources 6.4.0
Jinja2 3.1.4
jiter 0.5.0
joblib 1.4.2
jsonpatch 1.33
jsonpointer 3.0.0
kiwisolver 1.4.5
kubernetes 30.1.0
latex2mathml 3.77.0
lazy_loader 0.4
llama-cloud 0.0.13
llama-index 0.10.64
llama-index-agent-openai 0.2.9
llama-index-cli 0.1.13
llama-index-core 0.10.64
llama-index-embeddings-openai 0.1.11
llama-index-indices-managed-llama-cloud 0.2.7
llama-index-legacy 0.9.48
llama-index-llms-openai 0.1.29
llama-index-multi-modal-llms-openai 0.1.9
llama-index-program-openai 0.1.7
llama-index-question-gen-openai 0.1.3
llama-index-readers-file 0.1.33
llama-index-readers-llama-parse 0.1.6
llama-index-vector-stores-chroma 0.1.10
llama-parse 0.4.9
lmdb 1.5.1
logzero 1.7.0
lxml 5.3.0
Markdown 3.7
markdown-it-py 3.0.0
MarkupSafe 2.1.5
marshmallow 3.21.3
matplotlib 3.7.5
mdtex2html 1.3.0
mdurl 0.1.2
mmh3 4.1.0
modelscope 1.17.1
monotonic 1.6
MouseInfo 0.1.3
mpmath 1.3.0
mss 6.1.0
multidict 6.0.5
mutagen 1.47.0
mypy-extensions 1.0.0
mysql-connector-python 9.0.0
nest-asyncio 1.6.0
networkx 3.1
nltk 3.8.1
numpy 1.24.4
oauthlib 3.2.2
ollama 0.3.1
onnxruntime 1.18.1
openai 1.40.6
opencv-contrib-python 4.6.0.66
opencv-python 4.10.0.84
opentelemetry-api 1.26.0
opentelemetry-exporter-otlp-proto-common 1.26.0
opentelemetry-exporter-otlp-proto-grpc 1.26.0
opentelemetry-instrumentation 0.47b0
opentelemetry-instrumentation-asgi 0.47b0
opentelemetry-instrumentation-fastapi 0.47b0
opentelemetry-proto 1.26.0
opentelemetry-sdk 1.26.0
opentelemetry-semantic-conventions 0.47b0
opentelemetry-util-http 0.47b0
orjson 3.10.7
overrides 7.7.0
packaging 24.1
paddleocr 2.8.1
paddlepaddle 2.6.1
pandas 2.0.3
pillow 10.4.0
pip 24.2
ply 3.11
posthog 3.5.0
psutil 6.0.0
py 1.11.0
pyasn1 0.6.0
pyasn1_modules 0.4.0
PyAutoGUI 0.9.54
pyclipper 1.3.0.post5
pydantic 2.8.2
pydantic_core 2.20.1
pydub 0.25.1
PyGetWindow 0.0.9
Pygments 2.18.0
PyMsgBox 1.0.9
pyparsing 3.1.2
pypdf 4.3.1
pyperclip 1.9.0
PyPika 0.48.9
pypiwin32 223
pyproject_hooks 1.1.0
PyQt5 5.15.9
PyQt5-sip 12.12.2
pyreadline3 3.4.1
PyRect 0.2.0
PyScreeze 0.1.30
python-dateutil 2.9.0.post0
python-docx 1.1.2
python-dotenv 1.0.1
python-multipart 0.0.9
pytweening 1.2.0
pytz 2024.1
PyWavelets 1.4.1
pywin32 306
pywinauto 0.6.3
PyYAML 6.0.2
rapidfuzz 3.9.6
regex 2024.7.24
requests 2.32.3
requests-oauthlib 2.0.0
retry 0.9.2
rich 13.7.1
rsa 4.9
ruff 0.6.1
safetensors 0.4.4
scikit-image 0.21.0
scipy 1.10.1
semantic-version 2.10.0
sentencepiece 0.2.0
setuptools 73.0.1
shapely 2.0.5
shellingham 1.5.4
simple-tornado 0.2.2
simplejson 3.19.2
sip 6.7.12
six 1.16.0
sniffio 1.3.1
soupsieve 2.5
spark-ai-python 0.4.1
sparkai 0.3.0
SQLAlchemy 2.0.32
starlette 0.37.2
striprtf 0.0.26
sympy 1.13.2
tabulate 0.9.0
tenacity 8.5.0
termcolor 2.4.0
tidevice 0.12.10
tifffile 2023.7.10
tiktoken 0.7.0
tokenizers 0.19.1
toml 0.10.2
tomli 2.0.1
tomlkit 0.12.0
tornado 6.4.1
tqdm 4.66.5
transformers 4.44.0
typer 0.12.3
typing_extensions 4.12.2
typing-inspect 0.9.0
tzdata 2024.1
urllib3 2.2.2
uvicorn 0.30.6
volcengine-python-sdk 1.0.95
watchfiles 0.23.0
websocket-client 1.8.0
websockets 12.0
wheel 0.44.0
wrapt 1.16.0
yarl 1.9.4
zipp 3.20.0
既然如此,那就把原环境pyqt相关的包全部卸载,然后重新安装。
最后不报错了这个错了,问题解决。
不过又有其它报错。