Set up Python and libraries on your computer

1. Download and install the Anaconda executable file for your operating system and choose default options to install the software.

Anaconda also includes Jupyter Book that can be used to write and execute Python code.

2. Open the terminal (MacOS) or command prompt window (Windows) and check the Python install version by typing: python --version

If the version is 2.7 as default, update it to 3.x: Check where your anaconda3 is installed, and if it is installed for the local user only or all users. If Anaconda is installed for the local user only, enter: ls -l /usr/local/bin/python*ln -s -f /usr/local/bin/python3.8 /usr/local/bin/python If Anaconda is installed for all users, enter: ln -s -f /opt/anaconda3/bin/python3.8 /usr/local/bin/python

3. Create a virtual environment for Python using pipenv --python 3.8 or python3 -m venv tutorial-env. You can launch the virtual environment with pipenv shell.

Virtual environment is a virtual machine that can be created on your computer. It acts as a temporary machine for experimenting with code and executing scripts. A virtual environment can be deleted after use and doesn’t affect the normal use of your computer; code and code libraries run only inside the virtual environment.

4. Install the common libraries like Matplotlib, Numpy and Pandas using pip install commands.

Libraries and predefined functions can be called from your Python code. You can use them to perform mathematical functions, build data frames or display charts and graphs. Matplotlib: type pip install --upgrade matplotlib Numpy: type pip install --upgrade numpy Pandas: type pip install --upgrade pandas

5. Install and set up Atom or Visual Studio Code for writing code and executing scripts.

Atom is preferred by Mac users and Visual Studio Code by Windows users. They are the most common editors used to write code in Python and can also be used to execute the code within the built-in terminal. To install Atom: Go to, download the executable file, and install it on your computer. Install Terminal package in Atom so that it can open a terminal window: select Packages from the menu, search for platformio-ide-terminal, and click Install. Once installed, set the default path to launch Terminal within Atom as the default terminal window. On Windows, navigate to PCs : Settings / Shell Override: and set it to C:WINDOWSSystem32cmd.exe. To install Visual Studio, go to, download the executable file, and install it on your computer.

6. Set up a virtual environment within Atom/Visual Studio Code editors by opening the terminal, creating a directory for your training, activating python in a virtual environment, and installing libraries.

To create a directory for your training, enter: > mkdir cxl-training > cd cxl-training > cxl-training pipenv --python /opt/anaconda3/bin/python3.8 (Note: /opt/anaconda3/bin/python3.8 is the path where Python 3.8 was installed earlier) To activate Python in the cxl-training virtual environment, enter: > pipenv shell You will see the virtual environment name displayed before the prompt: (cxl-training) ➜  cxl-training >> Install libraries with these commands: pip install --upgrade matplotlib pip install --upgrade numpy pip install --upgrade pandas

7. Find out more information about Python and resources by visiting their websites and documentation pages.

Find information about Python at Read documentation and library reference material on their documentation and library reference pages.