Python Skills

Environment and Packages Management

For environment, you can use virtualenv to create a virtual python environment to seperate this to the original environment.

1
virtualenv XX

Note. the virtual env folder will be located to your current folder of the bash locates. When you change the path of the env folder, it will cause problem for some direct running module. Like pip, jupyter

For packages, you can use the following command to export installed packages in env1 and install those packages in env2

1
2
(env1) $ pip freeze > requirement.txt
(env2) $ pip install -r requirement.text