I have a VM with AGS server 10.5.1 and Arc desktop 10.5.1. I have 2 versions of Python present in the VM Win 2012 R2 server OS.
I am a newbie to Python - I have 15+ years of working in ArcObjects (VB n C#), Silverlight, and JS. I am trying to get a handle on the 'environment' for python and support existing code and develop new gp functions as needed.
before sitting in acgis geoprocessing course, I took the time to set up Anaconda and Jupyter to learn most of the syntax basics. the training was in Pyscripter and for some reason, it did not cause hiccups because it was a training machine on esri cloud. Anaconda and Jupyter worked fine then and now.
https://www.youtube.com/watch?v=WSXzlpVZM50&index=9&list=PLaPDDLTCmy4aA6oxJVe1YsJlxJO_0psyv&t=0s - (from 2018 dev summit) at 6+ minutes, it clearly indicates 2.x for ArcGIS desktop and 3.x for ArcGIS pro and server objects.
i am trying to 'debug' / support a ArcGIS server geoprocessing python script done for 10.1 or 10.2 (currently in production) and sooner or later, that will be 'migrated' to 10.6.
there are many pages that talk about using PyScripter 32 bit version - most of these pages/blogs were written in 2015 and no updates (most of non-ESRI pages). Are there newer 'how to' pages?
OS: Win 2012 R2
Py: 2.7.14 and 3.6.5 (64 bit)
Pyscripter - 18.104.22.168 x64 ; PyCharm community ed - 2017.3.4
arcgis (10.5.1) and arcgis 10.5.1
Both Pyscripter and Pycharm do not like "import arcpy" statement or any of the "from arcpy import AddMessage, ..." - all red squiggly lines in Pycharm and no intellisense or suggestions in Python Interpreter in Pyscript.
thanks for taking the time to read through this.
To recognize the arcpy in any python IDE, it should pointed to the python.exe path with receptive ArcGIS Python directory
Go to Configure and Settings. "Project Interpreter" is under the "Default Project" on left.
Click the settings gear in the upper-right, and then Add Local. Navigate to C:\Python27\ArcGIS10.5\python.exe (or respective path for your version)
Tools > Python Path - add these paths
Hope this video can help little bit more to understand
good afternoon. Thank you for the prompt reply.
I presume you approve of pyScripter's 64 bit version - compared to the 2015 pages that insisted on a 32 bit version. i will check these tomorrow n let you know.
Ravichandran I supposed to telling about use 32 bit PyCharm & 32 bit PyScripter only. I trust 64bit version should not support with ArcGIS Desktop only installation.
For 64bit IDE:
If ArcGIS Server available in same machine, please use the python.exe from 64bit path
If ArcGIS Server not available, have to install "ArcGIS 10.5 Desktop Background Geoprocessing (64-bit)" and use python 64 bit libraries only
I am not sure about PyScripter but PyCharm makes it very easy to switch interpreters when you have multiples of them. Here is a link to their documentation (Configuring Python Interpreter - Help | PyCharm ). They even pick up Conda environments if you have Anaconda installed. Here are the different types of python interpreters you may have on your computer depending on what you have installed.....
For more information about the version of python used for our products. Please see the following documentation depending on the version(ArcGIS Desktop 10.5.x system requirements—System Requirements | ArcGIS Desktop).
If you are getting a red line under the import statement, then it may be because of the interpreter the IDE is using does not have that module in it. You need to make sure that you are pointing to the right interpreter (see the list above) to get access to the arcpy module.
Thanks Munachiso O and Balaji Veera,
good afternoon. thanks for the clarifications. I uninstalled Python Interpreter/runtime 3.x 64 bit and I installed PyScripter 3.3.x 64 bit and it is able to see the arcPy objects in the command line interpreter.
Message for other newbies: as indicated above by both of them, 10.6 and higher ArcServer objects like 3.x python interpreter; where as 10.5.1, ArcServer components work ONLY with Py 2.7.x.
hope it helps. thanks for your guidance.