Py第十六问 ImportError: DLL load failed: %1 is not a valid Win32 application

Getting 64bit Python up and running with 64 bit packages on Windows is a bit of a pain.

Install WinPython 2.7.5.1 64bit, https://code.google.com/p/winpython/

Register the installation with windows with “WinPython Control Panel.exe” by going “Advanced” -> “Register distribution”

Now find a 64bit compilation of the package you want. Christoph Gohlke provides a major public good by hosting precompiled packages at http://www.lfd.uci.edu/~gohlke/pythonlibs/

In my case I needed opencv which meant downloading and installing “opencv-python-2.4.5.win-amd64-py2.7.‌exe”

Then in python import as usual “import cv”

Troubleshooting

If the package can’t find your winpython installation then you might not have registered it as described above.

If your installation of Spyder stops working, you may have to reset your PATH environmental variables. You can view and edit environmental variables more easily with a freeware program like Rapid Environment Editor. In my case, I had to uninstall all of my python installations and packages before it would start working again.

If you receive the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application.

Then it probably means you have 64 bit python but a 32 bit version of your package. Either find a precompiled version that is listed as 64 bit or you’ll have to compile it yourself.


原因是截图中的框框位数需要一致


本次是因为oracle驱动用了64位的客户端,而python cx_Oracle都是32位的,换成32位的oracle驱动解决

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值