Create and activate a virtual environment in Python (python)
Whosoever makes a static webpage that just has two things on it:
— Vicki Boykis (@vboykis) October 8, 2019
1. Unix/Mac/Windows command for creating a new venv environment
2. Unix/Mac/Windows command for activating new venv environment
will achieve super-high search rankings almost instantaneously.
https://venv.netlify.app/
Bash code:
cd project_folder
python -m venv venvname
source venvname/bin/activate
Activating the venv in other shells (see here):
Platform |
Shell |
Command to activate virtual environment |
---|---|---|
POSIX |
bash/zsh |
$ source <venv>/bin/activate |
fish |
$ source <venv>/bin/activate.fish |
|
csh/tcsh |
$ source <venv>/bin/activate.csh |
|
PowerShell Core |
$ <venv>/bin/Activate.ps1 |
|
Windows |
cmd.exe |
C:\> <venv>\Scripts\activate.bat |
PowerShell |
PS C:\> <venv>\Scripts\Activate.ps1 |