Select to view content in your preferred language

ImportError: No module named arcpy

7328
11
Jump to solution
01-14-2016 11:33 AM
KennethKirkeby
Deactivated User

So ..... I been working with ArcMap for 3 semesters and it went well so far. I enrolled in a Python programming class. 

ARCGIS wis installed in C:\Program Files (x86)\ArcGIS\Desktop10.3.

I downloaded Python 2.7.xx and installed it to C:\Python27.

>>> print("\n".join(sys.path))

C:\Python27\Lib\idlelib

C:\WINDOWS\SYSTEM32\python27.zip

C:\Python27\DLLs

C:\Python27\lib

C:\Python27\lib\plat-win

C:\Python27\lib\lib-tk

C:\Python27

C:\Python27\lib\site-packages

C:\Python27\lib\site-packages\win32

C:\Python27\lib\site-packages\win32\lib

C:\Python27\lib\site-packages\Pythonwin

How do I add the ARCGIS modules to this sys.path (IF that's what my problem is). Please be nice to the noob

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

yes, arcmap has to be reinstalled or it won't operate properly either since the python association is broken as are all the arcpy functionality and using the python IDE inside of arcmap won't work either.  the basic question remains... is arcmap required... or just python???

View solution in original post

11 Replies
DanPatterson_Retired
MVP Emeritus

you should have let arcgis install python...currently there should be a

c:\python27\arcgis10... or something in the path.  Install it from your installation disk.

from an earlier thread with this morning

from python 2.7

PythonWin 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information.
>>> import sys
>>> sys.path
['', '...',
 'C:\\Python27\\ArcGIS10.3\\DLLs',
 'C:\\Python27\\ArcGIS10.3\\lib',
 'C:\\Python27\\ArcGIS10.3\\lib\\plat-win',
 'C:\\Python27\\ArcGIS10.3\\lib\\lib-tk',
 'C:\\Python27\\ArcGIS10.3\\Lib\\site-packages\\pythonwin',
 'C:\\Python27\\ArcGIS10.3',
 'C:\\Python27\\ArcGIS10.3\\lib\\site-packages',
 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.3\\bin',
 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.3\\ArcPy',
 'C:\\Program Files (x86)\\ArcGIS\\Desktop10.3\\ArcToolBox\\Scripts',
 'C:\\Python27\\ArcGIS10.3\\lib\\site-packages\\win32',
 'C:\\Python27\\ArcGIS10.3\\lib\\site-packages\\win32\\lib']
>>>

And of course yours may differ...I am using ArcGIS10.3.1 and ArcGIS PRO

JimmyKroon
Frequent Contributor

I have never had to install python separately as it was installed with ArcGIS Desktop standard installation. If you don't have it, I'd go back through the ArcGIS installation.

What code editor are you using? It could be accessing a different installation of Python now.

0 Kudos
DanPatterson_Retired
MVP Emeritus

could be the new installation overwrote the old because of the differences in paths

0 Kudos
KennethKirkeby
Deactivated User

I uninstalled the original Python installation since I didn't think I would ever want to get into programing. Reinstall the latest version from Python.org.

Should have left the original in place. I thought it would be an easy fix to just point it at another install.

0 Kudos
DanPatterson_Retired
MVP Emeritus

just install it from the arcgis installation disk or download, if you want to continue to use arcpy.  If you are with an educational institution, you most likely get the latest and greatest for download for free... so no biggy, just reinstall arcmap or skip it altogether and just use your version...which can't be used for arcpy functionality

0 Kudos
JimmyKroon
Frequent Contributor

You don't need to program to need Python. Many geoprocessing tools in ArcToolbox are also written in Python. It can also be used in field calculator and labeling expressions, to name two uses. And arcpy is designed for certain versions of Python - newer versions may not work correctly. I'd definitely go back through the installation process.

0 Kudos
DanPatterson_Retired
MVP Emeritus

yes, arcmap has to be reinstalled or it won't operate properly either since the python association is broken as are all the arcpy functionality and using the python IDE inside of arcmap won't work either.  the basic question remains... is arcmap required... or just python???

KennethKirkeby
Deactivated User

I do need ArcMap. There's a reinstall in my future. Thanks!

0 Kudos
DanPatterson_Retired
MVP Emeritus

I move the thread to the Python place in case someone else has a suggestion that was overlooked.

0 Kudos