标签归档:pip

pypy+pip+virtualenv

安装pypy

yum install pypy*

安装pip

wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py 
pypy get-pip.py 

添加pypy pip别名

alias pypy_pip='/usr/lib64/pypy-2.2.1/bin/pip'

建立virtualenv

virtualenv ~/pypy -p `which pypy` 
source ~/pypy/bin/activate 
python --version 
deactivate

使用mirror给pip提速

默认配置下,使用pip安装python package速度非常慢,这时候可以考虑使用镜像. http://www.pypi-mirrors.org/

vim ~/.pip/pip.conf

[global]
trusted-host = pypi.doubanio.com
index-url = https://pypi.doubanio.com/simple/

使用命令行

pip config --global set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config --global set install.trusted-host mirrors.aliyun.com

更详细的pip.conf配置在:

http://www.pip-installer.org/en/latest/user_guide.html#configuration

centos6.5安装python3

安装开发工具

yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel \
 sqlite-devel readline-devel tk-devel

下载安装python

http://www.python.org/download/releases/

wget http://www.python.org/ftp/python/3.3.4/Python-3.3.4.tar.xz
tar xf Python-3.3.4.tar.xz
cd Python-3.3.4
./configure --prefix=/opt/python3
make && make install

下载安装pip

http://www.pip-installer.org/

wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
/opt/python3/bin/python3 get-pip.py

下载安装virtualenv

/opt/python3/bin/pip install virtualenv
/opt/python3/bin/virtualenv --distribute /pyproject
/pyproject/bin/pip install package