Step1 : Creating and activating a new virtual environment
$ python3 -m venv project_env
$ source project_env/bin/activate
We can create virtual environment with system-packages(global installation of Python packages).
$ python3 -m venv project_env --system-site-package
Step2 : Check installed packages on virtual environment
$ pip install pytz
$ pip list
Package Version
------- -------
certifi 2019.3.9
pytz 2018.9
We can get information of installed packages in txt format from pip freeze command with redirection.
$ pip freeze > requirement.txt
We can also install all the same packages stored in requirements.txt.
$ pip install -r requirements.txt
Step3 : Deactivating and Delete a virtual environment
$ deactivate
$ rm -rf project_env/
Source from : https://www.youtube.com/watch?v=Kg1Yvry_Ydk&list=PL-osiE80TeTskrapNbzXhwoFUiLCjGgY7&index=24
'OS > Linux' 카테고리의 다른 글
[kill process] How to find the Process ID and Kill it (0) | 2022.10.31 |
---|---|
[pipenv] Easily Manage Packages and Virtual Environments (0) | 2022.10.17 |
[python] Python Scripts (0) | 2022.09.22 |
[Theorem] Standard Streams/File Descriptors (0) | 2022.09.22 |
[Theorem] Redirection/Pipeline (0) | 2022.09.22 |