![](/img/trans.png)
[英]Py2exe - Can't run a .exe created on Windows 10 with a Windows 7 computer
[英]Py2exe and psycopg, build on Windows 10, can't run on Windows 7
我正在将python 2.7和psycopg一起使用。 如果我使用py2exe在Windows 7(具有完全捆绑)上构建可执行文件,则生成的.exe在Windows 7和10上运行良好。但是,如果我在Windows 10上构建.exe,则在Windows 10上运行良好,但是在Windows 7上令人恐惧:
Traceback (most recent call last):
File "test.opy", line 2, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "psycopg2\__init__.pyo", line 50, in <module>
File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading psycopg2\_psycopg.pyd
在这里,我使用的是一个test.py,实际上它只是:
import psycopg2
print "It worked!"
有人对我接下来应该尝试什么有任何想法吗?
PS:这绝对是捆绑销售的问题-捆绑销售可以正常工作,但是对于我想要的并不是理想的选择。
将此添加到setup.py中的选项字典中:
'dll_excludes':['Secur32.dll','SHFOLDER.dll','CRYPT32.dll']
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.