If you have questions or run into issues, reach out to Dr. Jordan Christian (jordan.i.christian@und.edu) or Kyle Gillett (kyle.gillett@und.edu)
Primary steps:
Other resources:
- Updating the UND ATSC Python Environment
- Activating the UND ATSC Python Environment
- Testing Your Installation
This repository contains installation instructions, scripts, and environments to set up Python on personal computers to complete coding assignments in UND ATSC courses.
Before setting up the Python environment, two installations are required:
- Python (version 3.11)
- JupyterLab
-
-
Open the Command Prompt, and type:
python --version
or
py --version
If the output shows
Python 3.11.xfor one of the commands typed above, move on to the JupyterLab installation, otherwise, follow the steps below to install Python 3.11.Install Python 3.11 for Windows by downloading the Windows installer (64-bit) under Python 3.11.9.
After the install is complete, type
python --versionorpy --versionin the Command Prompt to verify installation.
-
-
-
Open a Terminal, and type:
python3.11 --version
If the output shows
Python 3.11.x, move on to the JupyterLab installation, otherwise, follow the steps below to install Python 3.11.Install Python 3.11 for Mac by downloading the macOS 64-bit universal2 install under Python 3.11.9.
After the install is complete, type
python3.11 --versionin a Terminal to verify installation.
-
-
-
Open the Command Prompt, and type:
pip install jupyterlab
or
py -m pip install jupyterlab
Note: Depending on your python install, you may need to use
python,python3orpyat the beginning of the above command.
-
-
-
Open a Terminal, and type:
python3.11 -m pip install jupyterlab
-
-
Open the Command Prompt, and use the
cdcommand and navigate to the directory where you would like to keep the UND ATSC Python environment.-
If the Command Prompt, type:
git clone https://github.com/jordanichristian/und-atsc-python.git
Note: If the above command doesn't work, download and install Git for Windows. Keep all of the default selected options during the install. After installation is complete, close the Command Prompt, open a new Command Prompt, and try the
git clonecommand again in the Command Prompt. -
Then enter the new directory:
cd und-atsc-python -
Then, run the script
create_python_env_windows.batby typing:create_python_env_windows.bat
If successful, you should see the output:
"ATSC Python environment setup complete!"
-
-
Open the Command Prompt, and use the
cdcommand and navigate to the directory where you would like to keep the UND ATSC Python environment.-
In the Terminal, type:
git clone https://github.com/jordanichristian/und-atsc-python.git
-
Then enter the new directory:
cd und-atsc-python -
Then, run the script
create_python_env_mac_linux.shby typing:./create_python_env_mac_linux.sh
Note: If the script doesn't run, make it "executable" by typing:
chmod u+x create_python_env_mac_linux.shthen try running the script again.If successful, you should see the output:
"ATSC Python environment setup complete!"
-
After Python 3.11 and JupyterLab have been installed and the UND ATSC Python environment is set up, JupyterLab can be started with the following commands:
-
-
Open a Command Prompt and type:
jupyter lab
or:
py -m jupyterlab
-
-
-
Open a Terminal and type:
jupyter lab
-
-
The above commands will open a browser tab that will allow you to work with Jupyter notebooks (
.ipynbfiles).Click the current kernel name (usually Python 3 (ipykernel)) in the top-right corner of the notebook and change it to und_atsc_kernel. This ensures the notebook uses the packages installed in the UND ATSC Python environment.
Reach out to Dr. Jordan Christian (jordan.i.christian@und.edu) or Kyle Gillett (kyle.gillett@und.edu)
When updates are made to the UND ATSC Python environment, you may update your local environment using git pull
The setup scripts automatically remove the existing und_atsc_env and create a fresh environment using the latest requirements.txt.
Your personal Python scripts, notebooks, and other files are not affected!
-
-
Open Command Prompt and navigate to your
und_atsc_envdirectory using thecdcommand. Once inside, usegit pullto "pull down" the updates from GitHub:git pull --ff-only
-
Then rebuild the environment:
create_python_env_windows.bat
-
-
-
Open Command Prompt and navigate to your
und_atsc_envdirectory using thecdcommand. Once inside, usegit pullto "pull down" the updates from GitHub:git pull --ff-only
-
Then rebuild the environment:
./create_python_env_mac_linux.sh
-
FOR ADVANCED USERS ONLY: To troubleshoot issues, install or update packages, or run Python commands directly within the UND ATSC environment, first activate the environment. This also varies by operating system:
-
-
Open the Command Prompt and navigate to the
und-atsc-pythondirectory. For example:cd und-atsc-python -
Then activate the environment by typing:
und_atsc_env\Scripts\activate
After activation, you should see
(und_atsc_env)at the beginning of the Command Prompt, similar to:(und_atsc_env) C:\Users\your_username\und-atsc-python>To deactivate the environment when you are finished, type:
deactivate
-
-
-
Open a Terminal and navigate to the
und-atsc-pythondirectory. For example:cd und-atsc-python -
Then activate the environment by typing:
source und_atsc_env/bin/activateAfter activation, you should see
(und_atsc_env)at the beginning of the Terminal prompt.To deactivate the environment when you are finished, type:
deactivate
Note: The environment must be activated from the
und-atsc-pythondirectory unless you provide the full path to theund_atsc_envdirectory.
-
-
Follow the instructions above to activate your
und_atsc_envenvironment. -
When your environment is activated, type the following command into your terminal (Mac) or command prompt (Windows):
sounderpy --help
If a message pops up with instructions for using SounderPy, your environment is working and up to date!
Note: If that doesn't work, you may need to use
python -m sounderpy --help(also trypython3andpy)
