Setting Up Local Programming Environment¶
In order to run the code examples in this course, you need a local Python environment with sympy installed.
This notebook explains how to create a virtual environment using Python’s built-in venv module and how to install the required package with pip.
These instructions are intended for local installation only.
Prerequisites¶
Before creating the environment, make sure that Python 3 is installed on your computer.
You can check it with:
$ python3 --version
On some systems, the command may be:
$ python --version
A recent Python 3 version is recommended.
Create a Virtual Environment¶
Create a new virtual environment named deutsch-venv:
$ python3 -m venv deutsch-venv
If your system uses python instead of python3, use:
$ python -m venv deutsch-venv
Activate the Virtual Environment¶
For macOS and Linux users¶
Activate the environment with:
$ source deutsch-venv/bin/activate
After activation, your terminal prompt should show the environment name, for example:
(deutsch-venv) $
For Windows users¶
If you use Command Prompt:
> qiskit-env\\Scripts\\activate
If you use PowerShell:
> .\\deutsch-venv\\Scripts\\Activate.ps1
After activation, your terminal prompt should show the environment name.
Install Sympy¶
Once the virtual environment is active, upgrade pip and install qiskit:
$ python -m pip install --upgrade pip
$ python -m pip install sympy