pythonwin_arcgis 10.0_Exception Raised

2697
5
11-01-2015 11:08 PM
KhyatiPatel
New Contributor

I have ArcGIS 10.0 (python 2.6.5 - installed with it).

Besides, I installed python 2.7 and PYHTHONWIN (pywin32-219.win32-py2.7).

I am learning python following 'PYTHON Scripting for ArcGIS By Paul Zandbergen'.

- I tried to run a very simple script in python shell and it runs correctly.

- The same script when run in pythonwin it displays 'Exception raised while running script...'

Please guide. Any help appreciated.

Thanks.

0 Kudos
5 Replies
Luke_Pinner
MVP Regular Contributor

What is the exception?

AlexandreGAILING
Esri Contributor

as luke said, we need some detail on the exception to help .

Be aware tha your pythonwin 2.7 does not have the arcgis/arcpy package. so any "import arcgisscriting" or "import arcpy" will fail.

Note that python 2.7 comes withe every arcgis 10.1+ release , and that 10.0 support stops in december.

KhyatiPatel
New Contributor

Yes... the error I am getting is as below -

Traceback (most recent call last):

  File "<interactive input>", line 1, in <module>

ImportError: No module named arcpy

In this case - if the versions are an issue what are my options to work with Python?

I have access only to arcgis 10.0.

Thanks a lot to Luke and Alexandre.

0 Kudos
KhyatiPatel
New Contributor

Also, I just installed pythonwin 2.6 and still getting the same error

PythonWin 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32.

Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information.

>>> import arcpy

Traceback (most recent call last):

  File "<interactive input>", line 1, in <module>

ImportError: No module named arcpy

0 Kudos
AlexandreGAILING
Esri Contributor

what yo need to do is to install python from arcgis setup,  not to install python 2.6 with a standard python setup.

Esri's packaged python comes with any dependency needed.

you'l also find an alternate solution (i did not test, but it may work) here: How to make a separate Python installation that can call ArcGIS' arcpy? - Geographic Information Sys...