Select to view content in your preferred language

Spyder menu shortcut being created with menuinst from different python env

2497
5
08-14-2020 01:47 PM
NicholasKlein-Baer
Occasional Contributor

I was recently installing Spyder 4 using in my ArcGIS Pro (2.5) clone environment as described by Dan Patterson‌ in this post.

conda install spyder --no-pin

At the very end of the install process I noticed this text pertaining to the menu shortcuts:

DEBUG menuinst_win32:__init__(199): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:\Users\nkleinbaer\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone', env_name: 'arcgispro-py3-clone', mode: 'user', used_mode: 'user'
DEBUG menuinst_win32:create(323): Shortcut cmd is C:\Users\NKLEIN~1\AppData\Local\Temp\1\_MEI146642\pythonw.exe, args are ['C:\\Users\\NKLEIN~1\\AppData\\Local\\Temp\\1\\_MEI146642\\cwp.py', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone\\pythonw.exe', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone\\Scripts\\spyder-script.py']
DEBUG menuinst_win32:create(323): Shortcut cmd is C:\Users\NKLEIN~1\AppData\Local\Temp\1\_MEI146642\python.exe, args are ['C:\\Users\\NKLEIN~1\\AppData\\Local\\Temp\\1\\_MEI146642\\cwp.py', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone\\python.exe', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone\\Scripts\\spyder-script.py', '--reset']
DEBUG menuinst_win32:__init__(199): Menu: name: 'Anaconda${PY_VER} ${PLATFORM}', prefix: 'C:\Users\nkleinbaer\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone', env_name: 'arcgispro-py3-clone', mode: 'user', used_mode: 'user'
DEBUG menuinst_win32:create(323): Shortcut cmd is C:\Users\NKLEIN~1\AppData\Local\Temp\1\_MEI146642\pythonw.exe, args are ['C:\\Users\\NKLEIN~1\\AppData\\Local\\Temp\\1\\_MEI146642\\cwp.py', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone\\pythonw.exe', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone\\Scripts\\spyder-script.py']
DEBUG menuinst_win32:create(323): Shortcut cmd is C:\Users\NKLEIN~1\AppData\Local\Temp\1\_MEI146642\python.exe, args are ['C:\\Users\\NKLEIN~1\\AppData\\Local\\Temp\\1\\_MEI146642\\cwp.py', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone\\python.exe', 'C:\\Users\\nkleinbaer\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone\\Scripts\\spyder-script.py', '--reset']

The menu short cut doesn't work for one, but my primary concern is that (as far as I can tell) menuinst is not installed in my ArcGIS Pro python env. The only place I can find it on my system is in a completely separate python installation (miniconda). Is it possible that the conda shipped by ESRI is using packages from a different python install? If so that is concerning to me because it might mean it could modify/break those environments ...

Also, but less important, I don't understand why it is calling setting up the shortcuts to call pythonw.exe from that temp directory, rather from it's real home in the arcgispro-py3-clone directory. I think this is the reason it doesn't work off the bat, requiring me to manually fix the shortcut.

0 Kudos
5 Replies
DanPatterson
MVP Esteemed Contributor

If you have multiple python versions, fixing the shortcut is the key

replace arc_pro with your install folder

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

Somewhat dated, but still applies

/blogs/dan_patterson/2017/07/01/arcgis-pro-2-creating-desktop-shortcuts 


... sort of retired...
NicholasKlein-Baer
Occasional Contributor

Thanks Dan, 

I understand how to fix the shortcut itself (in large part thanks to that exact blog post you linked to  ).

But again, I'm really more worried about how the conda that shipped with ArcPro was using menuinst to set it up in the first palce, as that package only exists in my non-ESRI miniconda installation. Am I missing something? Is this a valid concern? I just don't want anything ESRI related screwing up my non-ESRI python envs.

0 Kudos
DanPatterson
MVP Esteemed Contributor

You installed Pro after your miniconda I suspect. spyder will use the python and use the packages in that path.

It isn't great/best to have separate miniconda's, just make sure that you activate the correct environment if you plan to switch back and forth (or if you are in a multi-machine environment... best yet is keep them totally separate  )


... sort of retired...
NicholasKlein-Baer
Occasional Contributor

The non-ESRI miniconda installtion is actually pretty new, Pro was certainly installed first (although I may have had another anaconda/miniconda installed at the time). 

I'm a bit confused? Do you really use the conda/python that comes Pro for all your Python needs? 

0 Kudos
DanPatterson
MVP Esteemed Contributor

I use it because I need arcpy and arcgis (the package) and the tools in arctoolbox.

If I want to mess around with python 3.8/(9) or that "learning" stuff, I do it on a separate machine.

I install everything I need in the base/main arcgispro-py3 environment. 

That includes the absolute latest versions of numpy, scipy etc etc since I focus on analysis, geometry and stats stuff.o

I don't use clones since you can unravel a bad situation easily.

  • >>> conda install --revision X   # ---- where X is the timestep before things went bad
    • ie you may have installed 3 packaged, the last went poorly, hence X becomes 2, the happier time
  • OR... uninstall Pro, rename every folder with, or related to, esri in your user folder by appending _OLD to it and run the *.msi from your downloaded *.exe.  It will enable you to install a fresh Pro (usually... unless you have to remove other pythons etc)

It has worked for me...  for years

Event though I am getting a tad impatient

https://community.esri.com/thread/257737-timeline-for-python-upgrade 


... sort of retired...
0 Kudos