Teststation Order from Chaos

Installing Python 3 with virtualenv on CentOS 7

It’s 2016 and CentOS 7 is still defaulting to Python 2.7! Thankfully Python 3 has landed in the EPEL repo and here’s how I got it working with virtualenv on a fresh install of CentOS 7:

  • Enable the EPEL repository with:
yum install epel-release
  • Install python34 and python-pip packages with:
yum install python34 python-pip
  • Update pip and install virtualenv with:
pip install -U pip
pip install -U virtualenv
  • Create and activate a new python3 virtualenv with:
virtualenv -p python3 <env_name>
  • Activate the environment and code away :D
cd <env_name> && source bin/activate