- Why am I doing this?
Running Jupyter
and PIP
becomes painful if you don't have admin privileges for your computer; A solution to this is to enter the entire path to PIP
and/or Jupyter
but it can very time consuming and inefficient. A way around this is to create and alias for the terminal to interpret a short command as if you were entering the entire path to PIP
and/or Jupyter
.
1. Find the location of your executables
These are the locations for Python
, pip
, and jupyter
in my computer:
> ~\AppData\Local\Continuum\Anaconda3\python.exe
>~\AppData\Local\Continuum\Anaconda3\Scripts\pip.exe
> ~\AppData\Local\Continuum\Anaconda3\Scripts\jupyter-notebook.exe
2. Create a PowerShell profile
Just type the following in your PowerShell terminal:
> New-Item -Type file -Force $profile
3. Find the location of your profile file
For my computer the location is the following:
> \Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
4. Edit your profile file with the following aliases
Set-Alias py "~\AppData\Local\Continuum\Anaconda3\python.exe"
Set-Alias pip "~\AppData\Local\Continuum\Anaconda3\Scripts\pip.exe"
Set-Alias jup "~\AppData\Local\Continuum\Anaconda3\Scripts\jupyter-notebook.exe"
Remember that the path above are specific for my computer, you should update according to the file structure in your own computer.
5. Close PowerShell and open a new session
6. Test the aliases in PowerShell
For example, type the following to launch a Jupyter notebook in any directory:
> cd Documents
> ezj
I am data scientist scientist, passionate about helping people using mathematics, programming and chemistry