Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

python venv

# Ubuntu/Debian
apt-get install python3-venv
python3 -m venv .venv
source .venv/bin/activate

# python 2
python -m virtualenv env
Comment

venv python

python3 -m venv env    # create env
source env/bin/activate    # activate env
deactivate    # deactivate env
rm -r env/    # delete env in Linux
pip freeze    # show all packages installed
pip install -r requirements.txt   # install all packages
pip freeze > requirements.txt    # create automatically requirements.txt
Comment

pyton venv

python -m venv newVirtualEnv				//create new virtual env
source newVirtualEnv/bin/activate  			//activate-lunix|unix
./newVirtualEnv/Scripts/activate.ps1 			//activate-Windows powershell
./newVirtualEnv/Scripts/activate.bat 		//activate-Windows cmd
cd newVirtualEnv/Scripts && . activate		//activate-Windows git bash:
  
//--Windows Execution_Policies error--
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

// check if using venv active - CLI does not have (newVirtualEnv) 
pip -V
Comment

python venv

#------FOR LINUX/MAC---------#
sudo apt-get install build-essential libssl-dev libffi-dev python-dev #installing requirements
sudo apt-get install -y python3-venv #installing venv 
python3 -m venv env #creating virtual env
source env/bin/activate #activating virtual env


#-------FOR WINDOWS----------# 
py -m pip install --user virtualenv #installing venv
py -m venv env #creating virtual env
.envScriptsactivate #activating virtual env
Comment

python venv

### install virtualenvwrapper ###
pip install virtualenvwrapper-win
### Add an environment variable WORKON_HOME to specify the path to store environments. By default, this is %USERPROFILE%Envs. ###

### ↓↓↓ use cmd or cmder (don't use ps terminal) for any of the following commands ↓↓↓ ###

### list venvs ###
lsvirtualenv

### create venv (automatically activated after creation) ###
mkvirtualenv <name>

### remove venv ###
rmvirtualenv <name>

### activate venv ###
workon <name>

### deactivate venv ###
deactivate


### General Syntax ###
mkvirtualenv [-a project_path] [-i package] [-r requirements_file] [virtualenv options] <name>
Comment

python virtual env

$ pip install virtualenv
Comment

python virtualenv

python -m venv my_env
source my_env/bin/activate
Comment

python virtualenv

python -m venv my_env
Comment

python virtualenv venv

python -m venv venv
Comment

virtualenv --python

virtualenv venv --python=python3.10

#you can change python version (eg. python3.10) , Folder name (eg. venv)
Comment

python virtual env

$ virtualenv --version
Comment

python virtual env

$ source venv/bin/activate
Comment

python venv

python -m venv flask_env  # Creating an isolated environment
source flask_env/bin/activate # Activate virtual environment
deactivate #deactivate
Comment

python virtual env

$ cd project_folder
$ virtualenv venv
Comment

python virtual env

$ virtualenv -p /usr/bin/python2.7 venv
Comment

python venv

python3 -m venv tutorial-env
// start it 
source tutorial-env/bin/activate
// end it 
deactivate
Comment

python venv

source <folder-env>/bin/activate
Comment

python3 -m venv venv

$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User")

[System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";C:UsersAdminUbuntu", "User")
Comment

python virtual env

$ export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7
Comment

python virtual env

$ pip install --user pipenv
Comment

PREVIOUS NEXT
Code Example
Shell :: git remove las remotet commit 
Shell :: install ifconfig on ubuntu 
Shell :: uninstall react-router 
Shell :: install pyzbar on linux 
Shell :: install git gui ubuntu 
Shell :: delete postmaster.pid mac 
Shell :: valet install command not found 
Shell :: git submodules pull 
Shell :: install latest node on centos 
Shell :: install nasm ubuntu 
Shell :: heroku download database 
Shell :: how to unzip in gitbash 
Shell :: jest vscode autocomplete 
Shell :: how to install pytube 
Shell :: give 777 permission folder and subfolders in linux 
Shell :: install docker raspberry 
Shell :: download draw.io for ubuntu 
Shell :: inkscape ubuntu ppa 
Shell :: install cmake anaconda 
Shell :: gitlab ci allow failure 
Shell :: make: g++: Command not found 
Shell :: kill gazebo 
Shell :: pip install pandas 
Shell :: surge install command 
Shell :: how to change a commit message after push 
Shell :: see disk info linux 
Shell :: how to start apache2 server 
Shell :: macos clear dns cache 
Shell :: add time from terminal linux in archlinux 
Shell :: git log from selected branch 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =