centos7安装python3环境

网址:https://www.cnblogs.com/caesar-id/p/10821105.html

1.登录普通用户

2.which virtualenvwrapper.sh  找到virtualenvwrapper.sh 路径如:/usr/local/bin/virtualenvwrapper.sh

3.配置  .bash_profile :

  3.1. mkdir env  新建env文件,用户虚拟环境的work_home 配置

  3.2. which python3 找到python3的路径,如:/usr/local/bin/python3

  3.3  vim ~/.bash_profile

    

export WORKON_HOME=~/envs      #设置virtualenv的统一管理目录
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
source /usr/local/bin/virtualenvwrapper.sh

  :wq!    保存关闭文件

  3.4.  source  ~/.bash_profile    运行使bash_profile中的配置生效

4.  mkvirtualenv djnginxpy3   :创建虚拟环境djnginxpy3

5. 等待创建完成后,即进入虚拟环境djnginxpy3

6. pip install -r requirements.txt  (再次之前先从别的虚拟环境中  pip freeze > requirements.txt ,得到requirements.txt文件)

  或者 pip install  -r -i https://pypi.tuna.tsinghua.edu.cn/simple  requirements.txt

7.

    

原文地址:https://www.cnblogs.com/jingzaixin/p/13402110.html