androidpythondllappcelerator

DLL load failed: %1 is not a valid Win32 application - Appcelerator


When I try to run an app in Appcelerator (3.1.x) on the built-in Android emulator I'm getting a Python error like this:

Traceback (most recent call last):
  File "C:\Users\Donny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.3.GA\android\fastdev.py", line 10, in <module>
    import urllib, threading
  File "C:\csvn\Python25\lib\urllib.py", line 26, in <module>
    import socket
  File "C:\csvn\Python25\lib\socket.py", line 47, in <module>
    import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.

I'm not proficient in Python, but what I understand from this question, this question and this one, is that I have a 32 bit version of Python trying to call a 64 bit DLL, right? I'm running on a 64 bit version of Windows 7, so this would make sense. If this is the case, how do I go about fixing this? Would I have to modify something in Appcelerator to use the 64 bit version of Python or possibly direct it to a 32 bit DLL instead?


Solution

  • It seems to be using this script to locate your system's Python. The script seems to be picking up a Python installation in C:\csvn\Python25 which apparently comes with Collabnet's SVN for Windows and is in all likelihood not a full Python installation.

    You should just install a standard 64-bit Python from python.org. That little batch script seems to suggest they support Python 2.5 and 2.6, though 2.7 would likely work too. Maybe to be on the safe side start with 2.6: http://www.python.org/download/releases/2.6.6/

    Just install to the normal default installation path of C:\Python26 and make sure that path is early on your %PATH% environment variable.