我使用
PyQT5
库制作了一个桌面应用程序。我使用的主要库是 opencv-python-headless
、mediapipe
和 pyserial
。所以,我的 python 脚本完全做了它应该做的事情并且完美地工作。但是当我用 pyinstaller
使其可执行后,它就崩溃了。主要是 mediapipe
库抛出这个错误:
Exception in thread Thread-3 (getReady_screen):
Traceback (most recent call last):
File "threading.py", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "app.py", line 344, in getReady_screen
File "app.py", line 193, in detect_squat
File "mediapipe/python/solutions/pose.py", line 146, in __init__
File "mediapipe/python/solution_base.py", line 271, in __init__
FileNotFoundError: The path does not exist.
我尝试使用这两个命令使我的脚本可执行,它们都抛出相同的错误:
pyinstaller --onedir app.py
pyinstaller --onefile app.py
这是我的目录的用户名和路径
squat@squat-OptiPlex-3050:~/squat-counting-application$
这些是我的
requirements.txt
文件中的内容:
absl-py==2.0.0
attrs==23.1.0
cffi==1.16.0
contourpy==1.1.1
cycler==0.12.1
docopt==0.6.2
flatbuffers==23.5.26
fonttools==4.46.0
importlib-resources==6.1.1
kiwisolver==1.4.5
matplotlib==3.7.4
mediapipe==0.10.8
num2words==0.5.13
numpy==1.24.4
opencv-python-headless==4.8.1.78
packaging==23.2
Pillow==10.1.0
protobuf==3.20.3
pycparser==2.21
pyparsing==3.1.1
PyQt5==5.15.10
PyQt5-Qt5==5.15.2
PyQt5-sip==12.13.0
pyqtspinner==2.0.0
pyserial==3.5
python-dateutil==2.8.2
PyYAML==6.0.1
six==1.16.0
sounddevice==0.4.6
zipp==3.17.0
检查这个。看起来像是项目中某个地方的拼写错误。