Python Primer
The purpose of this page is to help you get started with Python and accompanying tools.
One important question is where to start regarding pip and conda. Here is a quick read to help answer this question. For me, the generic answer is install both:
- Install conda
- Use conda to install pip
Conda Installation
The only downside to using conda, is that there is no automatic installation. You need to go to conda downloads to observe the url before continuing.
- Find the conda URL by righ-clicking on the appropriate link found on this page: conda downloads
- Build the url variable. Be sure to get the most recent file name - do not just copy/paste below)
- CONDA_FILE="Anaconda3-2023.09-0-Linux-x86_64.sh"
- CONDA_URL="https://repo.anaconda.com/archive/$CONDA_FILE"
- cd /tmp
- wget $CONDA_URL
- bash $CONDA_FILE
Follow the prompts. Most are logical. When asked "Do you wish to update your shell profile to automatically initialize conda?', select Yes.
References:
Instructions to Install and Configure PIP
If you used the above section to install conda:
conda install pip
If you are installing pip from scratch:
sudo apt update sudo apt install -y python3-pip pip install --upgrade pip sudo apt install -y python3-venv mkdir environments cd environments python3 -m venv my_env ls my_env source my_env/bin/activate
References:
Install Jupyter Notebook
# from above start -- repeated just in case not already done cd environments python3 -m venv my_env ls my_env source my_env/bin/activate # from above end pip install jupyter jupyter notebook # the previous command will launch your browser and open jupyter
References: