日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python配置pip_Python pip源配置

發(fā)布時間:2023/12/20 python 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python配置pip_Python pip源配置 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

pipy國內鏡像目前有:

Win7下配置pip源:

1、在win7用戶目錄下創(chuàng)建pip目錄,以用戶user為例:

C:\Users\user\pip

2、在pip目錄下新建pip.ini文件:

C:\Users\user\pip\pip.ini

3、配置文件內容:

以下是一個簡單的配置示例,供參考:

[global]

index-url = http://pypi.douban.com/simple

trusted-host =pypi.douban.com

disable-pip-version-check = truetimeout= 120[install]

ignore-installed = trueno-dependencies = yes

Linux系統(tǒng)配置pip源:

1、創(chuàng)建~/.pip/pip.conf

2、pip.conf配置內容同win7,如下:

[global]

index-url = http://pypi.douban.com/simple

trusted-host =pypi.douban.com

disable-pip-version-check = truetimeout= 120[install]

ignore-installed = trueno-dependencies = yes

virtualenv下配置pip源:

1、在virtualenv目錄下創(chuàng)建env/pip.conf

2、pip.conf內容同Linux,不再贅述。

手動指定pip源:

pip install -i http:///simple

例如:

pip install -i http://pypi.douban.com/simple simplejson

只要pip命令中出現(xiàn)的選項都可以配置在配置文件中,比如直接輸入pip命令,會提示以下選項,那么這些選項都可以寫在配置文件中:

General Options:

-h, --help Show help.

--isolated Run pip inan isolated mode, ignoring

environment variables and user configuration.

-v, --verbose Give moreoutput. Option is additive, and can be

used up to 3times.

-V, --version Show version and exit.

-q, --quiet Give lessoutput. Option is additive, and can be

used up to 3times (corresponding to WARNING,

ERROR, and CRITICAL logging levels).

--log Path to a verbose appending log.

--proxy Specify a proxy inthe form

[user:passwd@]proxy.server:port.

--retries Maximum number of retries each connection should

attempt (default 5times).

--timeout Set the socket timeout (default 120.0seconds).

--exists-action Default action when a path already exists:

(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.

--trusted-host Mark this host as trusted, even though it does

not have valid or any HTTPS.

--cert Path to alternate CA bundle.

--client-cert Path to SSL client certificate, a single filecontaining the private key and the certificate

inPEM format.

--cache-dir

--no-cache-dirDisable the cache.

--disable-pip-version-check

Don't periodically check PyPI to determine

whether a new version of pip is available fordownload. Implied with --no-index.

可根據(jù)需要自行添加。

總結

以上是生活随笔為你收集整理的python配置pip_Python pip源配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。