Skip to content

Files

Latest commit

2961b40 · Apr 30, 2024

History

History
This branch is up to date with rasbt/pycon2024:main.

00-1_python-setup-guide

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 30, 2024
Apr 30, 2024

Python Setup Tips

 

Tip

A reproducible cloud environment will be shared with participants on the day of the workshop, so no setup steps are required. However, this document provides suggestions for those who wish to install the dependencies locally on their own machines.

 


There are several different ways you can install Python and set up your computing environment. Here, I am illustrating my personal preference.

(I am using computers running macOS, but this workflow is similar for Linux machines and may work for other operating systems as well.)

1. Download and install Miniforge

Download miniforge from the GitHub repository here.

download

Depending on your operating system, this should download either an .sh (macOS, Linux) or .exe file (Windows).

For the .sh file, open your command line terminal and execute the following command

sh ~/Desktop/Miniforge3-MacOSX-arm64.sh

where Desktop/ is the folder where the Miniforge installer was downloaded to. On your computer, you may have to replace it with Downloads/.

miniforge-install

Next, step through the download instructions, confirming with "Enter".

2. Create a new virtual environment

After the installation was successfully completed, I recommend creating a new virtual environment called dl-fundamentals, which you can do by executing

conda create -n dl-workshop python=3.9

new-env

Next, activate your new virtual environment (you have to do it every time you open a new terminal window or tab):

conda activate dl-workshop

activate-env

Optional: styling your terminal

If you want to style your terminal similar to mine so that you can see which virtual environment is active, check out the Oh My Zsh project.

3. Install new Python libraries

To install new Python libraries, you can now use the conda package installer. For example, you can install JupyterLab and watermark as follows:

conda install jupyterlab watermark

conda-install

You can also still use pip to install libraries. By default, pip should be linked to your new dl-workshop conda environment:

check-pip


Any questions? Please feel free to reach out in the Discussion Forum.