Setting up and activating virtual environments with venv differs between Unix and Windows operating systems.

Creating and activating a virtual environment on a Unix system:

$python3 -m venv ./.venv$ source .venv/bin/activate


Creating and activating a virtual environment on a Windows system: :

c:\> c:\Python35\python -m venv c:\path\to\.venv
c:\> .venv\Scripts\activate.bat


Here are some resources and additional documentation about setting up virtual environments:

marcinszydlowski1984

Good explanation but it’s worth to mention that it’s not necessary to enter additional “./” during create a virtual environment. python3 -m venv .venv is enough.

Bartosz Zaczyński RP Team

@marcinszydlowski1984 Technically, you don’t even need the leading dot, as this will work too:

$python3 -m venv venv  Personally, I like to include the trailing forward slash to remind myself and others that the second argument is a path or the folder name: $ python3 -m venv venv/


to join the conversation.