using pyvenv in Centos 7

Recently, I need to use python 3 in Centos 7.

In order to use python 3, you need to enable epel

yum install epel-release

then you can yum install python3.4

Everything seems to be fine until you setup a virtual environment using pyvenv you will receive this error.

pyvenv-3.4 returned non-zero exit status 1

You need to add –without-pip option to make this work….

pyvenv-3.4 myvenv –without-pip

But then you will not have pip to use… you need to manually install pip… The easiest way is to use get-pip.py

Go to this site, then download get-pip.py

https://pip.pypa.io/en/stable/installing.html

then activate your virtual env.

source myvenv/bin/activate

cp the get-pip.py file to your virtual env folder then run

python get-pip.py

Then you will have a working pythong environment in Centos 7.