WindowsError: [Error 193] %1 is not a valid Win32 application in Python

让人想犯罪 __ 提交于 2019-11-29 08:00:21

Please make sure to have Python 2.7 64b edition :) or even though you are working on 64b OS, use the x86 (AKA 32b) edition of PyScripter

Edit 1 (following comments exchange w/ Gianni)

One should verify his/her entire Python process "composed" from same entities in the sense of 32b/64b builds (e.g. if your Python interpreter is 32b one, then it must use C types coming from C dll Python extensions which were compiled as 32b dlls).

In our example (liblas) one should go to C:\Python27\lib\site-packages\liblas , find the extension dll and see its type via dumpbin , here is some picture for demonstration :

This error can also be caused because the DLL that Python is attempting to run has been compiled on a newer version of C++. Make sure you are running the latest version of the Microsoft C++ Distribution.

You can see the version you are running in the Python terminal window (highlighted in bold)

Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32

Download here

https://www.microsoft.com/en-us/download/details.aspx?id=48145

You are probably using 64 bits Python. You should install the 32 bits version instead.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!