部署到server 2012上报错:DLL load failed while importing pyexpat: 找不到指定的模块
报错原因:
报这个错是由于没有安装MS visual C++,下载链接:https://www.microsoft.com/en-us/download/details.aspx?id=53587 参考资料:
Introducing the Universal CRT - C++ Team Blog (microsoft.com)
ImportError: DLL load failed while importing pyexpat-CSDN博客
python - ImportError: DLL load failed while importing pyexpat: 找不到指定的模块_Stack Overflow中文网 办理方法:
方法1:
安装MS visual C++(我没有乐成,安装时windows server 2012报错缺少dll),以是只能手动将全部的dll文件都包含到python项目
方法2:
1.安装Microsoft Visual Studio,下载链接:Visual Studio: IDE and Code Editor for Software Developers and Teams
2.打开{安装目次}Microsoft Visual Studio\2022\Professional\Common7\IDE\Remote Debugger\x64\,搜索内里全部的.dll文件,复制到一个文件夹里(我的文件名为dll dict),将该文件夹放到python项目目次下,并配置.spec文件的binaries项,如下图
打包成.exe文件后 运行报错:numpy: Error importing numpy: you should not try to import numpy fromits source directory; please exit the numpy source tree, and relaunchyour python interpreter from there.