I'm having an issue importing arcpy into my Python scripts outside of ArcGIS. I've completely uninstalled Python and deleted the directory. I then used the 10.2 install disc to repair my version of ArcGIS hoping that doing so would correct any issues created from having python 2.7 installed prior to ArcGIS 10.2 installation. Yet after the repair I tried to run my .py file and it gave me this error again. (Error attached as jpg)
so if everything is ok as shown in this link in the help files then a complete reinstall might be in order
Sounds like something is amiss
1 do you have multiple versions of python installed
2 assuming you are using the version of python required for your version of arcmap, it should look like this for arcmap 10.2.x
C:\Python27\ArcGIS10.2\.....
plus a bunch of others.
This is my only directory under python 27
C:\Python27\ArcGIS10.2
which is what the ArcGIS 10.2 disc installed after I completely uninstalled python. The attachment also shows all the files located under that directory.
I feel it might be useful to mention thought, that under the directory below, arcpy can be found. It just seems to me there is a connection issue between python / IDLE and my actual arcpy library. But I'm not skilled in how to fix an issue like this.
C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy
can you get past the import line in the interactive window
>>> >>> # done within the interactive window of both pyscripter and pythonwin >>> >>> import arcpy # if it fails here... python is not installed properly >>> # now get some information >>> arcpy.__name__ 'arcpy' >>> arcpy.__path__ ['C:\\Program Files (x86)\\ArcGIS\\Desktop10.2\\arcpy\\arcpy']
I can get past it if im not trying to import arcpy. I have a few other scripts that run smoothly. The issue only arises when I am trying to do anything that requires me to import arcpy.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.