How to Setup a Python Virtual Environment on CentOS

January 8, 2020 Liquid Web

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

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

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

About the Author

Liquid Web

Liquid Web powers online content, commerce, and potential for SMB entrepreneurs and the designers, developers and digital agencies who create for them. Sign up for our newsletter to stay up to date with our latest content.

More Content by Liquid Web
Previous Video
How to Install TensorFlow on CentOS
How to Install TensorFlow on CentOS

In this video, we demonstrate to you how to do install TensorFlow on CentOS via the Python package manager ...

Next Video
Premium Business Email Control Panel Walk Through
Premium Business Email Control Panel Walk Through

In this helpful tutorial, find out how to turn on spam settings, add additional email users, add additional...

Learn What Qualities to Look for in Your Next Host in Our New Guide!

Download Now