Newbie: Which Pyscripter 64/32 bit? VM Win 2012R2, AGS 10.5.1

1364
5
04-23-2018 02:07 PM
Ravichandran_M_Kaushika
Occasional Contributor

dear Readers,

good afternoon.

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 - 3.3.1.0 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.

regards

ravi kaushika

0 Kudos
5 Replies
BalajiVeera
Occasional Contributor

To recognize the arcpy in any python IDE, it should pointed to the python.exe path with receptive ArcGIS Python directory

Pycharm: 

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)

PyScripter:

Tools > Python Path - add these paths

C:\Python27\ArcGIS10.5\DLLsC:\Python27\ArcGIS10.5\libC:\Python27\ArcGIS10.5\lib\lib-tk C:\Python27\ArcGIS10.5C:\Python27\ArcGIS10.5\lib\site-packages C:\Program Files (x86)\ArcGIS\Desktop10.5\binC:\Program Files (x86)\ArcGIS\Desktop10.5\arcpy C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcToolbox\Scripts

Hope this video can help little bit more to understand

3 - Simple Script - Arcgis Scripting with Python - YouTube 

0 Kudos
Ravichandran_M_Kaushika
Occasional Contributor

Balaji Veera,

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.

regards

ravi kaushika

0 Kudos
BalajiVeera
Occasional Contributor

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

 C:\Python27\ArcGISx6410.2\python.exe

If ArcGIS Server not available, have to install "ArcGIS 10.5 Desktop Background Geoprocessing (64-bit)" and use python 64 bit libraries only

0 Kudos
MunachisoOgbuchiekwe
New Contributor III

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..... 

  • Python(2.x 32 bit) is used for ArcMap Desktop.
  • Python (2.x 64 bit) is used for ArcGIS Server.
  • Python (3.x 64 bit) is used for ArcGIS Pro. 

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. 

0 Kudos
Ravichandran_M_Kaushika
Occasional Contributor

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.

regards

ravi.

0 Kudos