[GIS] import arcgisscripting gives ImportError: DLL load failed: %1 is not a valid Win32 application

64bitarcgis-9.3arcpywindows 7

i am trying to import arcgisscripting and getting following error.

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

I have windows 7 64 bits, i have installed python-2.7.3.amd64, pywin32-219.win-amd64-py2.7
and using arcgis9.3. i have set pythonpath accordingly which is set to python and arcgis/bin folder as well. But still getting the same error.

I have spent almost whole day to fix this issue and tried all the exisiting solutions but didnt get any success, i think my arcgis 9.3 is not 64 bits.

Best Answer

As commented by @AlexTereshenkov installing a 64bit version of Python 2.7.3 with ArcGIS Desktop 9.3 is ill advised.

If you uninstall ArcGIS Desktop and Python, and then let ArcGIS Desktop install Python for you I suspect you will be up and running within an hour.

As you can see from the System Requirements for ArcGIS Desktop 9.3/9.3.1 the Python version needed appears to be 2.5.1:

Python Requirement for Geoprocessing:
Several ArcGIS geoprocessing tools, such as Multiple Ring Buffer, use the Python scripting language and require that Python is installed. If the ArcGIS Desktop, Engine or Server setups do not find Python 2.5.1 on the target computer, it will install Python 2.5.1 plus Numerical Python 1.0.3 during a typical or complete installation. You may choose a Custom installation to unselect the Python feature to avoid installing this feature. See the install guide for additional information concerning Python.