DLL load failed: not valid Win32 application

I am loading sen2cor for use with SNAP and can’t find this issue within previous posts.

conda -v = conda 4.2.9

I have anaconda installed and tried the update listed in the Sentinel-2 MSI – Level-2A Prototype Processor Installation and User Manual and then successfully installed Sen2Cor. However I get a win32 error.

DLL load failed: 1% is not a valid win32 application

I also tried a new anaconda2 and sen2cor installation and get the same error. I assume I have a conflict with numpy from a separate folder/application, but don’t know how to force sen2cor scripts to use a different python/numpy. I’m not keen to un-install numpy as its used in so many other scripts on the other application. Is there are known method to force sen2cor script to run from a specific version to remove the error I am seeing?

In SNAP my defaults for sen2cor are

SEN2COR_HOME - C:\Users…\sen2cor
SEN2COR_BIN - C:\Users…\Anaconda2\Lib\site-packages\sen2cor-2.2.1-py2.7.egg/sen2cor
PYTHON_BIN - C:\Users…\Anaconda2\python.exe

looks like you have an 32bit Python version floating around somewhere else (ArcGIS for example) on your pc.

Did you install Anaconda 64 bit?

Do you know the location of other Python versions on your PC?

What happens if you type “python” in your command shell? There you can see if the standard python installation is 32 bit or 64 bit?
If it is 32 bit, you can try to remove the path to the other python installation (not the Anaconda one) from your system’s PATH variable. But maybe you check the upper points first.

1 Like

Python from command line is
Python 2.7.12 !Anaconda 4.2.0 ,64 bit.: [MSC v.1500 64 bit on Win32

I installed Anaconda 64 bit and the OS is 64 bit.

Directory search shows 2 python.exe
One newly installed C:/Users/…/Anaconda2
One at C:\Python27\ArcGIS10.3\etc as error shows. I thought this was 64 bit, but clearly not!

I’m not keen to un-install the other python. so I’ll look into PATH variables. Having not done this before, am I looking to delete the (PATH) to the Python27 version or make the (PATH) from the Anaconda2 version default? Or have I misunderstood?

Thank you for your help.

exactly. I’m not sure if it is a solution but you could definitely prevent the ArcGIS python version (as far as I know always 32 bit) to conflict with it.
So make a backup of your PATH variables and see if there are some paths to other python folders besides Anaconda2. Remove these from your PATH list.

There’s no need for uninstalling other pythons (ArcMap would certainly crash) but as long as your system won’t find them when python scripts are called it should be fine.