[Python] virtualenv creation procedure memo

Often I had projects on the same server that depended on different library versions. Therefore, it is convenient to be able to specify an independent Python environment using virtualenv, so a memo of the procedure.

Install virtualenv

 $ sudo conda install virtualenv
# $ sudo pip install --upgrade virtualenv (For pip)

Creating a virtualenv environment

 $ virtualenv --system-site-packages targetDirectory # for Python 2.7
 $ virtualenv --system-site-packages -p python3 targetDirectory # for Python 3.n

Activate the virtualenv environment

 $ source targteDirectory/bin/activate

This will switch the prompt as follows:

(targteDirectory)$

Deactivate virtualenv environment

(targteDirectory)$ deactivate

Recommended Posts

[Python] virtualenv creation procedure memo
Python memo
python memo
Python memo
python memo
Python memo
Python memo
Python memo
[Python] Memo dictionary
python beginner memo (9.2-10)
python beginner memo (9.1)
★ Memo ★ Python Iroha
Python 3 operator memo
[My memo] python
Python3 metaclass memo
[Python] Basemap memo
python in virtualenv
Python beginner memo (2)
[Python] Numpy memo
Python class (Python learning memo ⑦)
My python environment memo
python openCV installation (memo)
Visualization memo by Python
django-debug-toolbar installation procedure memo
[Python] Memo about functions
python regular expression memo
Binary search (python2.7) memo
[My memo] python -v / python -V
Slack chatbot creation Python
Python3 List / dictionary memo
[Memo] Python3 list sort
Python Tips (my memo)
manylinux1 wheelhouse creation procedure
[Python] Memo about errors
DynamoDB Script Memo (Python)
python recipe book Memo
Basic Python command memo
Python OpenCV tutorial memo
Python basic grammar memo
TensorFlow API memo (Python)
python useful memo links
Python decorator operation memo
Python basic memo --Part 1
Effective Python Memo Item 3
[Python] What is virtualenv
Divisor enumeration Python memo
python memo (for myself): About the development environment virtualenv
Set-enable Python virtualenv on Windows
Python memo (for myself): Array
Python exception handling (Python learning memo ⑥)
Python CMS Mezzanine installation procedure
Python 3.6 installation procedure [for Windows]
Twitter graphing memo with Python
Manage python environment with virtualenv
[Line / Python] Beacon implementation memo
Python and ruby slice memo
Python Basic Grammar Memo (Part 1)
Anaconda3 python environment construction procedure
virtualenv Basic command usage memo
Raspberry Pi + Python + OpenGL memo
Python basic grammar (miscellaneous) Memo (3)