Created
August 12, 2018 08:00
-
-
Save vanleantking/1271b96321061741af2da500d4a15fb3 to your computer and use it in GitHub Desktop.
virtualenv backup python environtment using
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.activate current env at your path | |
pyvenv-3.5 ~/Envs/thesis_python3/ | |
source ~/Envs/thesis_python3/bin/activate | |
2. list all of modules using in the current environtment by using freeze | |
pip freeze > requirements.txt | |
(this command with generate txt file list all modules have installed) | |
3. create new env, and from this new env, install all modules have list in the txt file | |
pip install -r requirements.txt | |
Another solution, copy current env to another env: | |
cp -R ~/Envs/thesis_python3 ~/Envs/bk_thesis_python3 | |
use your favorite editor to edit activate file of the new env | |
sudo vim bk_thesis_python3/bin/activate | |
Find the line VIRTUAL_ENV="~/Envs/thesis_python3" and replace it with | |
~/Envs/bk_thesis_python3 (your backup env) | |
--Enjoy....-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment