Skip to content
Go back

python-pip配置

Edit page

python pip 配置

配置国内代理

pip install -r [package] --proxy=[IP]:[PORT]
# Unix 系
vim /etc/profile:
    export http_proxy='http://[IP]:[PORT]'
    export https_proxy='http://[IP]:[PORT]'
source /etc/profile

# Windows
cd %HOMEPATH%
md pip & cd pip
echo [global]>>pip.ini
echo. proxy='http://[IP]:[PORT]'>>pip.ini
echo. proxy='http://[IP]:[PORT]'>>pip.ini

配置国内镜像

pip install [package]  -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
# Unix 系
vim ~/.pip/pip.conf:
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
source /etc/profile

# Windows
cd %HOMEPATH%
md pip & cd pip
echo. timeout = 6000>>pip.ini
echo. index-url = https://pypi.tuna.tsinghua.edu.cn/simple>>pip.ini
echo. trusted-host = https://pypi.tuna.tsinghua.edu.cn>>pip.ini

Edit page
Share this post on:

Previous Post
python-数据分析之numpy
Next Post
RC4