2.5. Launch Jupyter FAST!#
To save you some typing, you may create aliases in Windows or macOS and launch Jupyter Notebook by just typing the aliases dsm, venv, and jn like:
PS C:\Users\[user]> dsm
PS C:\Users\[user]\workspace\dsm> venv
(.venv) PS C:\Users\[user]\workspace\dsm> jn
[I 2025-09-07 16:35:42.748 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2025-09-07 16:35:42.757 ServerApp] jupyter_server_terminals | extension was successfully linked.
These aliases do the following for you:
dsmwill move your present working directory to your project folder dsm.venvwill activate your virtual environment.jnwill launch your Jupyter Notebook.
2.5.1. Windows#
In Windows, you may add aliases to your user profile to make your life with Jupyter a little easier. You add aliases to your profile. To check whether you have a profile defined already, do the following in PowerShell:
PS C:\Users\[user]> echo $PROFILE
C:\Users\[user]\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
echo means print in the terminal. You should see the system-defined file path and the profile file name as above.
You need to edit the profile using Notepad or VS Code. If the profile exists already, the following command will open the *.ps1 file, and you copy and paste the ##### venv code ##### code block below to your profile, exit Notepad to save the profile. You then close all terminal sessions and exit PowerShell, open PowerShell again, and the aliases should work:
PS C:\Users\[user]]> notepad $PROFILE
Some systems have the $PROFILE environment variable defined, but do not have the profile path/folder and the profile file created. In that case, when you do notepad $PROFILE, you are trying to open a file that does not exist yet. You may therefore receive an error message or warning saying that the $PROFILE folder (WindowsPowerShell) or the profile file (Microsoft.PowerShell_profile.ps1) does not exist. If so, create them by doing the following steps:
First, check to see if the profile folder exists. If it does, you will be able to change directory into it (the folder is usually WindowsPowerShell or PowerShell, and it is under the user’s Documents folder):
PS C:\Users\[user]> cd $PROFILE\.. ### **cd** into the folder
PS C:\Users\[user]\Documents\WindowsPowerShell> ### ready to edit profile
If the profile folder WindowsPowerShell or PowerShell does not exist, you need to create it:
PS C:\Users\[user]> cd .\Documents\
PS C:\Users\[user]\Documents> mkdir WindowsPowerShell ### or "PowerShell" depends on your system
PS C:\Users\[user]\Documents> cd WindowsPowerShell ### cd into the profile folder
PS C:\Users\[user]\Documents\WindowsPowerShell> ### ready to edit profile
After you are in the profile folder, use Notepad or VSCode to edit or create the profile. The profile (*.ps1) name may be different for different versions of Windows. Use the one you have when doing echo $PROFILE:
PS C:\Users\[user]\Documents\WindowsPowerShell> notepad Microsoft.PowerShell_profile.ps1
Notepad will pop up, and you then copy and paste the ##### venv code ##### code block below to the profile to create the aliases:
########## venv code ############################################################
##### 1. dsm: change directory to introdsm ######
function CDIntroDSM {set-location ~\workspace\dsm\} ### create the change direcotry function
New-Alias "dsm" CDIntroDSM ### create the alias dsm to the function
##### 2. venv: activate virtual environment #####
New-Alias -Name "venv" -Value .\.venv\Scripts\activate ### activate venv alias
##### 3. jn: start Jupyter notebook ##############
function JupyterNotebook { ### create the "jupyter notebook" function
param(
[string]$notebook = "notebook"
)
jupyter $notebook
}
New-Alias -Name "jn" -Value JupyterNotebook ### alias to run the function
########## end of venv code ######################################################
2.5.2. macOS#
For Mac users, you can add the following lines to your ~/.bashrc file, and you should be able to use the aliases to launch Jupyter Notebook fast. To edit the .bashrc file, open the terminal and type code .bashrc. VS Code will then open the file for you to edit.
alias dsm='cd ~/workspace/dsm'
alias venv='source .venv/bin/activate'
alias jn='jupyter notebook'