【发布时间】:2021-01-27 18:23:28
【问题描述】:
我的机器上安装了 python 3.8.5,我安装了 pyuic5 并使用它将 .ui 转换为 .py 文件(使用 cmd)。我最近升级到 python 3.8.7,现在每当我尝试转换时,我都会收到这个错误:
C:\Users\....>pyuic5 -x Windows.ui -o Windows.py
Fatal error in launcher: Unable to create process using '"d:\program files\python3.8.5\python.exe" "D:\Program Files\Python 3.8.7\Scripts\pyuic5.exe" -x Windows.ui -o Windows.py': The system cannot find the file specified.
我确保 pyqt5 和 pyuic5 已正确安装。我不是专家,但我相信 cmd 正在从 python3.8.5 文件夹(我安装的旧版本)而不是 python3.8.7 文件夹中寻找 python.exe 文件。
【问题讨论】:
-
使用
pyuic5 -x /full/path/of/Windows.ui -o Windows.py -
我已经试过了,可惜没用。问题中提到的命令总是可以工作,但无论如何升级后都不能工作。也许你有其他想法?为什么我的 cmd 试图查看“d:\program files\python3.8.5\python.exe 而不是 3.8.7?
-
@AhmedZeid 检查您的 PATH 环境变量。确保它包括
\Lib\site-packages\PyQt5 (并摆脱任何旧的)。 -
@ekhumoro,我做到了,仍然是同样的错误。事情是“d:\program files\python3.8.5\python.exe”在我的电脑上什至不存在。如何更改该路径?