Hi there!
Could somebody indicate to me how to reference a Spyder installation located in a separate Conda environment in ArcGIS' options such that it acts as default Script Editor?
I tried to reference
to the field under Project > Options > Geoprocessing > Script Editor without success.
In advance, thank you for your advice.
I am using ArcGIS Pro 2.9.2 (with a clone of the default python environment) and Spyder 5.1.5 (in a separate environment).
Desktop shortcut
Target :
C:\arc_pro\bin\Python\envs\arcgispro-py3\pythonw.exe "C:\arc_pro\bin\Python\envs\arcgispro-py3\Scripts\spyder-script.py"
Start in:
C:\arc_pro\bin\Python\envs\arcgispro-py3\Scripts
Project, Options, Geoprocessing, Script Editor
C:\arc_pro\bin\Python\envs\arcgispro-py3\pythonw.exe "C:\arc_pro\bin\Python\envs\arcgispro-py3\Scripts\spyder-script.py"
Now just replace arc_pro to your clone folder assuming ...\bin\Python\envs\arcgispro-py3 ... will need to be edited as well with your clone name
Also, within spyder make sure you are point the editor to the correct python in your path(s)
Thank you, @DanPatterson, for your answer.
I had come across your blog posts from previous years related to this topic and tried to apply the suggestions stipulated there (i.e. second bullet from my initial post, or your answer to it). Unfortunately, it does not work. I suppose it is due to the fact that spyder does not reside in the same conda environment arcgis uses...
C:\tools\Anaconda3\envs\
- arcgis-env
- spyder-env
Calling the following .bat file from the cmd I can open an arbitrary script from ArcGIS temp folder, however, setting this as default script editor does not work. What happens upon right-click on a script tool in ArcGIS, i.e. how is the script passed to the file specified under the specified script editor?
@ECHO off
SET script=%1
call C:\tools\Anaconda3\Scripts\activate.bat C:\tools\Anaconda3\envs\spyder-env
cd C:\Users\Workstation\AppData\Local\Temp\ArcGISProTemp15984
spyder %script%
You have to set spyder to use python in the arcgis-env. It is discussed in their help topics
Installation Guide — Spyder 5 documentation (spyder-ide.org)
and there is nothing stopping you from installing spyder in Pro's environment
>>> conda install spyder=5.1.5 --no-pin