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.
$ sudo conda install virtualenv
# $ sudo pip install --upgrade virtualenv (For pip)
$ virtualenv --system-site-packages targetDirectory # for Python 2.7
$ virtualenv --system-site-packages -p python3 targetDirectory # for Python 3.n
$ source targteDirectory/bin/activate
This will switch the prompt as follows:
(targteDirectory)$
(targteDirectory)$ deactivate
Recommended Posts