rodrigosantosbr

inbuilt support for creating virtual environments.

Aug 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

to create and activate a virtual environment for this project, let’s run the following commands:

mkdir pytest_project
cd pytest_project
python3 -m venv pytest-env

This creates a virtual environment called pytest-env in our working directory.

To begin using the virtualenv, we need to activate it as follows:

source pytest-env/bin/activate

As long as the virtualenv is active, any packages we install will be installed in our virtual environment, rather than in the global Python installation.

To get started, let’s install pytest in our virtualenv.

pip install pytest
Add Comment
Please, Sign In to add comment