![]() If this is all correct, try typing import arcpy into the interpreter. You should see a Python interpreter open up and you should see the correct version 2.7.8. Open a new cmd and type the name you used (i.e. Make sure you have added the C:Python27ArcGIS10.3 directory into your path in your Windows Environment Variables. Copy/paste this exe and rename it arcpy or something else that you can remember. ![]() You should see a folder called ArcGIS10.3 or whichever version you have installed.Ĭlick into ArcGIS10.3 and locate the Python.exe executable. Even if you include the correct path inside your Windows Environment Variables, it will not work because when you type python into the Command Line Interface, Windows does not know which Python install to use. I found that this is because the Python path being used by my machine is the 2.7.11 path, rather than the 2.7.8 path (the ArcGIS-specific Python install). My intention for creating an EXE is to bundle everything needed into one place. Also, my script ties into three other scripts that also need to be distributed along with the main script. Yet, I still could not get ArcPy to import w/o error. While I understand that anyone who has ArcGIS already has Python, there are other Python modules (aside from arcpy), that the users need for the script to work. When I followed the instructions at Importing ArcPy, I found that the path C:Python27ArcGIS10.3Libsite-packages had a file called Desktop10.3.pth in it with the following lines: C:Program Files (x86)ArcGISDesktop10.3binĬ:Program Files (x86)ArcGISDesktop10.3ArcPyĬ:Program Files (x86)ArcGISDesktop10.3ArcToolBoxScripts Solution is top-notch, but not perfect for every use case.įor example, in my use case, I had a Python 2.7.11 install on my machine and then I installed ArcGIS which came with Python 2.7.8. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |