0

if I'm programming a Python script, and in my script, I import ArcPy.

Is that downloaded with ArcMap?

Also, in that case, if I give the script to someone who doesn't have ArcMap, and thus don't have ArcPy, does that mean the script won't run as they're trying to import something that doesn't exist on their computer?

So if I'm sending a script to someone, would I have to send all of the libraries I'm importing with it?

4

ArcPy is installed when you install ArcMap. If you want someone else to run your Python scripts that use the ArcPy modules, then they should have ArcMap installed and licensed as well. It all depends on what you are trying to accomplish.

Note, some tools need to have a certain license level and will refuse to run if the users' workstation does not have an that license... also there are extensions that need to be licensed separately like Spatial Analyst, 3D Analyst, and others. You can include in your script these checks:

CheckProduct and CheckExtension to verify if the license/product environment is suitable.

  • 3
    They will not only need to have ArcGIS Desktop installed, but also licensed. – PolyGeo Aug 28 '17 at 22:19
  • 3
    Not only installed and licensed but with an appropriate license level. Some tools need to have a certain license level and will refuse to run if the users' workstation does not have an that license... also there are extensions that need to be licensed separately like spatial analyst, 3d analyst etc.. You can include in your script CheckProduct resources.arcgis.com/en/help/main/10.2/index.html#//… and CheckExtension resources.arcgis.com/en/help/main/10.2/index.html#/… verify if the license/product environment is suitable. – Michael Stimson Aug 28 '17 at 22:57
4

So if I'm sending a script to someone, would I have to send all of the libraries I'm importing with it?

Further to Mattropolis' answer, you cannot just send the arcpy libraries. Arcpy requires ArcGIS to be installed and appropriately licensed, so sending the arcpy libraries will achieve nothing. I'm unsure if the import will succeed, but if it does then any tools you attempt to run will most certainly fail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.