作為 easy_install 的升級版,pip 為 Pyhton 的包管理提供了極大的方便。一行命令即可完成所需模塊的安裝:
pip install pandas
可是官方鏡像的訪問速度相當慢,幾乎不可用。因此十分有必要修改鏡像源來提升訪問速度,
修改鏡像源在不同操作系統中,修改文件的位置是不同的,
在linux默認的路徑是 $HOME/.pip/pip.conf
在windows默認的路徑是 %HOME%\pip\pip.ini
默認路徑下並不存在配置文件,需要新建,然后在配置文件中寫入:
[global] index-url = http://pypi.mirrors.ustc.edu.cn/simple/
即可修改鏡像源,等號之后的部分就是鏡像源的地址。
我收集了幾個中國的PyPI鏡像源,最上方的源在我這訪問速度最快,速度依次向下遞減,所以試一試前幾個就好了。
阿里雲 http://mirrors.aliyun.com/pypi/simple/ 中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/ douban http://pypi.douban.com/simple Python官方 https://pypi.python.org/simple v2ex http://pypi.v2ex.com/simple 中國科學院 http://pypi.mirrors.opencas.cn/simple/ 清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/