Select to view content in your preferred language

PROBLEMS IMPORTING ARCGISSCRIPTING

2957
7
10-10-2012 06:27 AM
RoyMartinez1
Emerging Contributor
I'm learning how to code in Python but I'm not able to import the ArcGIS modules either in IDLE or PythonWin when I perform the following.  By the way I'm using ArcMap 9.3.1, also the file arcgisscripting.pyd is in my C:\Program Files\arcgis\Bin folder

#Import modules
import arcgisscripting, sys, os


Code resulted in the following error message:

import arcgisscripting
ImportError: Module use of python25.dll conflicts with this version of Python.

I have done the following to check where python is pointing

import sys, pprint
pprint.pprint(sys.path)


which resulted in the following:

'C:\\Program Files\\Python26\\Lib\\idlelib',
'C:\\Program Files\\ArcGIS\\bin',
'C:\\Windows\\system32\\python26.zip',
'C:\\Program Files\\Python26\\DLLs',
'C:\\Program Files\\Python26\\lib',
'C:\\Program Files\\Python26\\lib\\plat-win',
'C:\\Program Files\\Python26\\lib\\lib-tk',
'C:\\Program Files\\Python26',
'C:\\Program Files\\Python26\\lib\\site-packages',
'C:\\Program Files\\Python26\\lib\\site-packages\\win32',
'C:\\Program Files\\Python26\\lib\\site-packages\\win32\\lib',
'C:\\Program Files\\Python26\\lib\\site-packages\\Pythonwin'

I would greatly appreciate it if someone could provide some details on how I can fix this problem.
Tags (2)
0 Kudos
7 Replies
DanPatterson_Retired
MVP Emeritus
You should have installed Pythonwin from the ESRI ArcGIS installation CD, it sets up the appropriate file associations and the correct version of Python and Pythonwin for the version of arcmap that you are using.
0 Kudos
RoyMartinez1
Emerging Contributor
You should have installed Pythonwin from the ESRI ArcGIS installation CD, it sets up the appropriate file associations and the correct version of Python and Pythonwin for the version of arcmap that you are using.


This is my work computer which came with Python 2.6.5 preinstalled when it was assigned to me.  Maybe I need to uninstall and reinstall Python.
0 Kudos
DanPatterson_Retired
MVP Emeritus
You can have concurrent versions of Python running ... but that would be a good start
0 Kudos
RoyMartinez1
Emerging Contributor
You can have concurrent versions of Python running ... but that would be a good start


What I noticed in the error message from my original post, is that when attempting to use python 2.6.5 it was attempting to call the Python25.dll.  Shouldn't it be calling something like Python26.dll?  Also, is python 2.6.5 compatiable with ArcGis 9.3.1?
0 Kudos
MathewCoyle
Honored Contributor
is python 2.6.5 compatiable with ArcGis 9.3.1?


I do not believe so. You will need Python 2.5.x
0 Kudos
ThaiTruong
Deactivated User
What I noticed in the error message from my original post, is that when attempting to use python 2.6.5 it was attempting to call the Python25.dll.  Shouldn't it be calling something like Python26.dll?  Also, is python 2.6.5 compatiable with ArcGis 9.3.1?


Even though 2.6 is not officially support, you can try to make it works with 9.3.1 with this configuration:

  1. After install Python 2.6.x, download and install its corresponding pywin32 from this site
  2. Get this arcgisscripting.py script written by Philippe Le Grand from this old thread and place it into C:\Python2.6\Lib\site-packages

0 Kudos
RoyMartinez1
Emerging Contributor
Thank you all for the helping hand.
0 Kudos