centos下部署python3
centos下安装python3(如果默认有python2)
yum install zlib openssl openssl-devel
如果用apt:
sudo apt-get install zlibc zlib1g-dev libssl-dev openssl
下载python编译安装
wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgztar zxvf Python-3.4.3.tgzcd Python-3.4.3./configure --with-pydebug && make && make installmv /usr/bin/python /usr/bin/python_oldln -s /usr/local/bin/pip3 /usr/local/bin/pipln -s /usr/local/bin/python3.4 /usr/bin/pythonvi /usr/bin/yum #!/usr/bin/python -> #!/usr/bin/python_old
创建并进入虚拟环境(windows版没有pyvenv)
pyvenv tutorial-envcd tutorial-envsource bin/activate
安装其它库
pip install numpy
虚拟环境信息
pip show requestspip list
生成依赖关系
pip freeze > requirements.txt
安装当前环境所需依赖库
pip install -r requirements.txt