How to Setup a Python Virtual Environment on CentOS


In this video, we demonstrate to you how to do setup a Python virtual environment on CentOS

Commands used:
[[email protected] ~]# yum update -y
[[email protected] ~]# python3 -m venv python3-virtualenv
[[email protected] ~]# pip3 freeze
[[email protected] ~]# source python3-virtualenv/bin/activate
(python3-virtualenv) [[email protected] ~]#
(python3-virtualenv) [[email protected] ~]# python –version
(python3-virtualenv) [[email protected] ~]# pip install -U pip requests
(python3-virtualenv) [[email protected] ~]# pip freeze
(python3-virtualenv) [[email protected] ~]# deactivate
[[email protected] ~]#
[[email protected] ~]# pip2 install virtualenv
[[email protected] ~]# virtualenv -p $(which python2) python2-virtualenv
[[email protected] ~]# source python2-virtualenv/bin/activate
(python2-virtualenv) [[email protected] ~]#
(python2-virtualenv) [[email protected] ~]# python –version
(python2-virtualenv) [[email protected] ~]# pip install requests
(python2-virtualenv) [[email protected] ~]# pip freeze
(python2-virtualenv) [[email protected] ~]# deactivate
[[email protected] ~]#

The related article for this article can be found here: https://www.liquidweb.com/kb/how-to-setup-a-python-virtual-environment-on-centos/

For more information about this and other topics, visit us at https://www.liquidweb.com/kb/ or
For more information on our VPS product, visit us at https://www.liquidweb.com/products/vps/ to learn more about our current specials!

Video by: Justin Palmer


Duration: 00:03:49
Publisher: Liquid Web
You can watch this video also at the source.