Re: winpython 64bits ImportError: DLL load failed: %1 is not a valid Win32 application.

6,623 views
Skip to first unread message

jbv

unread,
Oct 12, 2012, 5:59:48 AM10/12/12
to winp...@googlegroups.com
Answering to myself:
sys.path has C:\Python27, C:\Python27\DLLs, and C:\Python27\Lib in it.
By removing them I am able to import matplotlib without problems.
However I do not see how to not have this paths by default in order to make the launcher work? I tried:
- adding a set PYTHONPATH in env.bat
- add sys.path.remove('C:\\Python27') in site.py
Any idea someone?


On Thursday, October 11, 2012 3:29:47 PM UTC+2, jbv wrote:
Hi,
First thanks a lot for all your work with python on windows !!
However when I try to use the 64bits version some actions result with this exception :

ImportError: DLL load failed: %1 is not a valid Win32 application.

This is the case :
- when I try to run the Ipython or Spyder launcher
- when I try to import matplotlib

Interestingly if I import numpy or scipy no problems.
On the computer winpython 32bits works like a charm and I also have another python 32bits (not from winpython) installation that is declared in the PATH environment variables and PYTHONPATH environment variables (maybe that's the problem??)

Kind regards,
Jbv.

jbv

unread,
Oct 16, 2012, 8:04:39 AM10/16/12
to winp...@googlegroups.com
Hi!
Thanks a lot! I removed C:\Python27\DLLs and C:\Python27\Lib from PYTHONPATH and now it works.
My other 32bits installation in C:\Python27 works as well.

On Monday, October 15, 2012 6:25:21 PM UTC+2, Sol Simpson wrote:
Hi there, I also have a 64 bit PC (Win 7) and have my default Python (2.7.3) at C:\Python27 with the following in my system PATH variable:

C:\Python27;C:\Python27\Tools\Scripts;C:\Python27\Scripts;C:\Python27\Lib\site-packages\PyQt4

 and I do 'not' have any issue running the latest winpython 64bit distro.

So my guess would be that it is the:

C:\Python27\DLLs, and ( or ) C:\Python27\Lib 

That is the issue, as I do not have these in my path, and have no issue running standard python 32bit programs from my standard cmd by typing python myscript.py that includes calls to matplotlib or psychopy functionality for example.

So one thing to try would be to remove the C:\Python27\DLLs, and ( or ) C:\Python27\Lib from your PATH, but 'not' the C:\Python27.

Another thing to try is, if you run spyder using the scripts\spyder.bat and not the base winpython spyder.exe, do you still get the error? I ask because it looks like using the spyder.bat replaces your existing PATH, where as the exe build process prepends the PATH with various winpython paths,  all overlap with winpython versions of what is in your path 'but' for C:\Python27\Lib . So I would 'guess' that C:\Python27\Lib  in your path is what the issue is, as winpython is not putting anything in the path beforehand that 
would take precedence.

Not sure if any of this will help.

Sol
Reply all
Reply to author
Forward
0 new messages