使用pyinstaller打包出现的报错

DLL load failed:找不到指定模块

问题描述:
在这里插入图片描述
导入PyQt5的时候,出现DLL load failed:找不到指定模块的报错
解决方案:
使用pyinstaller打包出现的报错_第1张图片
使用 pip install --upgrade pyinstaller 更新pyinstaller,问题解决

no module name’numpy.random.common’

导入的numpy包不支持
使用

pip uninstall numpy
pip install numpy==1.16.2

打包的程序太大

因为anaconda打包程序会附带打包链接的额外程序。建议使用pipenv虚拟环境来打包。

#建立虚拟环境
pipenv install
#进入虚拟环境
pipenv shell
#安装模块
pip install 小工具.py里面用到的模块
#打包的模块也要安装
pip install pyinstaller
#开始打包
pyinstaller -F  sample.py

或者使用原生python环境打包。

你可能感兴趣的:(python)