Select to view content in your preferred language

How to Import arcpy  in Python 3.2

1963
1
05-04-2012 08:47 PM
BruceGreen
Occasional Contributor
Hi,

I had to upgrade my python to python 3.2 on windows 64 now I am trying to import arcpy in the IDLE an I am encountering with "ImportError: No module named arcpy". I add the PYTHONPATH (Desktop10.pth) from python26\Lib\site-packages folder  to Python 3.2 directory and it stop complaining about arcpy but now I am getting "ImportError: cannot import name gp" Error message!

Can you please let me know how I can run arcpy module in python 3.2?

Regards,
Tags (2)
0 Kudos
1 Reply
V_StuartFoote
MVP Alum
Behrouz,

The ArcPy site library from ArcGIS 10.0 is hard linked against 32-bit Python 2.6; and at ArcGIS 10.1 it will be against 32-bit Python 2.7

It will not work in Python 3.2, and certainly won't work in 64-bit Python.

If you have an ArcGIS Desktop License you can work against the 32-bit ArcObjects COM assemblies with Python wrappers, several threads on doing so:

Frank Perks comments on mapping COM assemblies with comtypes.client
http://forums.arcgis.com/threads/15848-ArcMap-10-ArcObjects-and-Python-very-cool-but-help-with-a-cou...

Or external refs:
http://gis.stackexchange.com/questions/80/how-do-i-access-arcobjects-from-python
based on M. Cederholms seminal work
http://www.pierssen.com/arcgis/upload/misc/python_arcobjects.pdf

But I haven't followed how they then behave in 64-bit Python environment if they work at all.

Good luck.

Stuart
0 Kudos