ArcGIS Pro 2... Creating Desktop Shortcuts

7570
12
07-01-2017 06:22 AM
Labels (1)
DanPatterson_Retired
MVP Emeritus
4 12 7,570

Shortcuts

UPDATE: 2018-12-14

If you have to clone your environment and want to get spyder running and don't want the console window drifting around on your desktop all dark and dreary... you can create a shortcut as

C:\ArcGISPro\arcgispro-py3-dan\pythonw.exe "C:\ArcGISPro\arcgispro-py3-dan\Scripts\spyder-script.py"

Now... lets break it down

  • C:\ArcGISPro\                                   Where I installed ArcGIS Pro  (currently 2.3)
  • C:\ArcGISPro\arcgispro-py3-dan\   Where I put my clone
  • C:\ArcGISPro\bin\Python\                Where pythonw.exe is installed by esri

So all you need to do is change the install folder for ArcGIS Pro if it needs to be installed somewhere else.

The rule is

  • Drive:\Esri_Install_Folder\bin\Python        esri's install location
  • Drive:\Your_clone_folder\                            Your folder to find pythonw.exe

Don't if you can help it

  • Install in folders with spaces... can't be helped sometimes, but install folders are sometimes an issue
  • Try not to use the "Users" folder …. sometimes you don't have the option at work

--------- Some illustrations from the past, but I won't correct the paths ------------------------------------------------

Here are a few tips for creating desktop shortcuts to make working with Pro a tad easier.

Installation of packages is given in pictoral form at the end of the blog (I sort of forgot... )

I like to have stuff easily accessed. Desktop icons work for me. Here is an example of having the pro.bat, Spyder and Jupyter IDE icons created and organized in one spot.

Launch File Explorer and find your installation folder. In my case, I installed Pro in a folder with the same name.  The rest of your folder structure will be the same after this point. Navigate to the jupyter-qtconsole-script.py script within the path (see 1 and 2 in the figure)

Once the properties dialog is open, click on Shortcut, then ensure your path emulates the example below.  It consists of two parts... the first is the location of python.exe within the installation path... the second is the aforementioned script which is run and noted above.  I make sure that the Start in: is specified as well.

If you work on your machine solely, you can click on the Advanced button in the previous dialog and toggle off the Run as administrator checkbox.  This will just avoid you having to answer a security question when the shortcut is used.

And now you are done.

I created one for proenv.bat as well as Spyder for ArcGIS Pro since I use different versions of Spyder and python and separate conda distributions, so I keep different shortcuts.

Here are the equivalent options for the Spyder shortcut.

Target...  (pythonw.exe location and the spyder-script.py location)

         C:\ArcPro\bin\Python\envs\arcgispro-py3\pythonw.exe "C:/ArcPro/bin/Python/envs/arcgispro-py3/Scripts/spyder-script.py"

 Starts in....
     C:\ArcPro\bin\Python\envs\arcgispro-py3\Scripts
Now you can fire up that puppy and put it to some useless work.
So that is the Jupyter QtConsol... on to Spyder and Pythonwin later....
Enjoy
----------------------------------------------------------------------------------------------------------------------------------
A pictoral guide to installing packages in Pro
Get to the package manager
To get there, look south-west
Install, update and add.  If you miss anything, just go back and add it.
That is about it.
12 Comments
BlakeTerhune
MVP Regular Contributor

Although completely unrelated to your post, thank you for turning me onto sys.prefix and the ".." symbolic path. Not sure I have an immediate use for such a thing, but still kinda cool!

DanPatterson_Retired
MVP Emeritus

You sortof have to know where you are going... old dos-like cd.. equivalent

pt0 = os.path.abspath(os.path.join(sys.prefix,".."))
pt1 = os.path.abspath(os.path.join(sys.prefix,"..", ".."))
pt2 = os.path.abspath(os.path.join(sys.prefix,"..", "..",".."))
pt3 = os.path.abspath(os.path.join(sys.prefix,"..", "..","..", ".."))
args = [pt0, pt1, pt2, pt3]
print(("{}\n"*len(args)).format(*args))
# ---- the reveal ----
C:\ArcPro\bin\Python\envs
C:\ArcPro\bin\Python
C:\ArcPro\bin
C:\ArcPro
# ---- with ----
sys.prefix
'C:\\ArcPro\\bin\\Python\\envs\\arcgispro-py3'
JoshuaBixby
MVP Esteemed Contributor

Dan, would it be worth mentioning that Jupyter is not part of the base Python installation with ArcGIS Pro 2.0?  I could see some users I work with reading this blog and assuming it is, and hence wondering why the files you reference, e.g., jupyter-qtconsole-script.py, are not in the folder you show in the screenshots.  I realize it may be stating the obvious for some users, but I don't think it is for all users.

DanPatterson_Retired
MVP Emeritus

I will add that to my Blog post... stating the obvious, rarely is thanks

BrandanScully
New Contributor

Dan-

My arcgispro-py3 env doesn't have a jupyter-qtconsole-script.py file on fresh install of ArcGIS Pro 2.0. I installed Jupyter and Spyder from the python package manager, but Jupyter is starting with a dead kernel that I can't resolve. I put it to SO (python - Arcgis Pro 2.0 Jupyter Notebook Install Fails - Stack Overflow ), but here's the traceback:

SNIPPed trackback

Traceback  system cannot find the file specified

Any tips would be appreciated.

DanPatterson_Retired
MVP Emeritus

You are looking for the Jupyter Notebook link, not the Jupyter Console, to which I refer..

The target for Jupyter Notebooks is

C:\ArcPro\bin\Python\envs\arcgispro-py3\pythonw.exe "C:/ArcPro/bin/Python/envs/arcgispro-py3/Scripts/jupyter-notebook-script.py"

and the 'Start in' link is

C:\Some_folder\JupyterNoteBooks

which needs to be your notebook folder

RenRosin
New Contributor III

Hi Dan,

I'm trying to follow your instructions for "Creating Desktop Shortcuts in PRO" but I don't have the jupyter-qtconsole-script.py file. do I need to install jupyter-run-script.exe first?

DanPatterson_Retired
MVP Emeritus

Ren... did you install it jupyter qtconsole that is??

A picture once you install it

RenRosin
New Contributor III

Hi Dan,

No, I didn’t install it because I couldn’t find the file ‘jupyter-qtconsole-script.py’ it’s not in that directory. Where does it get generated from? Should I run ‘juputer.exe’

Here is a screenshot from my file explorer showing the ‘jupyter’ files that are in that directory:

C:\Users\rrosin\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Scripts

Ren Rosin

Engineering / GIS Technician

Bella Vista Water District

11368 East Stillwater Way

Redding, CA 96003

Tel: (530) 241-1085 x 113

DanPatterson_Retired
MVP Emeritus

Ren

There are several 'jupyters' each are different, you will have to decide which one you want

jupyter qtconsole

jupyter notebook

jupyter labs

or all of them for a full constellation

It is kindof like Arc.... software …. similar names, different functionality etc

Besides if you are on the clone side of the clone wars, just use Pro's package manager... it will install them for you then you can find the scripts and make the shortcuts.

I did conda installs of all the jupyters and they work fine, but I don't use the clone approach

RenRosin
New Contributor III

To be honest, I use Notebook++ to view all my queries, in your opinion is there any advantage of using jupyter? Does it give you python snippets or anything like that? I'm just trying to get my python scripts to work in Pro. Do you have any suggestions?

DanPatterson_Retired
MVP Emeritus

Spyder … I have blogs on it. It is my main IDE.  I have used many of the favorites that others may mention (pyscripter, pycharm, pywhatever) but I do like spyder a lot

Spyder in pictures

/blogs/dan_patterson/2018/01/28/spyder 

I use Jupyter Qt for quick snippets, jupyter notebook and labs for the quasi-webby stuff and I even have pythonwin installed because of nostalgia and code folding.

Spyder 4 (currently in Beta) is supposed to have code folding, but I haven't had time to mess with it yet.

About the Author
Retired Geomatics Instructor at Carleton University. I am a forum MVP and Moderator. Current interests focus on python-based integration in GIS. See... Py... blog, my GeoNet blog...
Labels