Python3.6.x PyInstaller给出错误;没有名为';PyQt5.sip'&引用;

Python3.6.x PyInstaller给出错误;没有名为';PyQt5.sip'&引用;,python,pyqt5,sip,pyinstaller,Python,Pyqt5,Sip,Pyinstaller,我开发了一些在Python 3.5.4上运行良好的程序,但由于win32的一些错误,我选择了Python 3.6.4,但当我使用pyinstaller构建项目时,我得到: C:\Users\User\Desktop\dist\mycommentator>mycommentator.exe Traceback (most recent call last): File "mycommentator.py", line 6, in <module> File "c:\use

我开发了一些在Python 3.5.4上运行良好的程序,但由于win32的一些错误,我选择了Python 3.6.4,但当我使用pyinstaller构建项目时,我得到:

C:\Users\User\Desktop\dist\mycommentator>mycommentator.exe
Traceback (most recent call last):
  File "mycommentator.py", line 6, in <module>
  File "c:\users\user\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module
    module = loader.load_module(fullname)
ModuleNotFoundError: No module named 'PyQt5.sip'
[1532] Failed to execute script mycommentator
C:\Users\User\Desktop\dist\mycommentator>mycommentator.exe
回溯(最近一次呼叫最后一次):
文件“mycmentator.py”,第6行,在
文件“c:\users\user\appdata\local\programs\python36\lib\site packages\PyInstaller\loader\pyimod03\u importers.py”,第714行,在load\u模块中
模块=加载程序。加载\u模块(全名)
ModuleNotFoundError:没有名为“PyQt5.sip”的模块
[1532]无法执行脚本mycommentator
我试图重新安装python,所以我安装了Python3.6.4/Python3.6.5,这个错误也发生在我身上。 无论我在PyQt5中生成什么代码,每次都会出现此错误

我还试图将
sip.pyd
移动到项目文件夹中,但仍然发生错误。 我还尝试了
pip安装——升级sip
,但没有效果。
我还尝试安装pyinstaller的开发版本,但也没有帮助。

我遇到了同样的问题,这显然是一个已知的错误,因为现在分别安装了
sip

创建安装程序后,我添加了以下行:

--隐藏导入PyQt5.sip


这没有问题。

尝试在虚拟环境中运行它。。试试
pipenv
virtualenv
我会试试。ThanksI确实
brew安装了python
以升级到python
3.7
,而且它可以工作!!这有助于我构建项目,但这样做我有一个新问题:在构建之后,我的GUI失去了自己的风格(Windows)。我怎样才能修好它?是的。Pyqt将默认为操作系统。使用
qss
来设置样式。或者,如果您喜欢gui进行设计,也可以使用qt designer。我不是这个意思。我指的是默认主题。它失去了自己的默认主题。外观:外观:image link I修复了卸载pyinstaller和安装pyinstaller的develop分支时丢失样式的问题:
pip installhttps://github.com/pyinstaller/pyinstaller/archive/develop.zip
非常感谢!