標籤:
1、先到官網 http://pypi.python.org/pypi/setuptools 下載setuptools.exe檔案並安裝
2、安裝完畢後建議把D:\Python27\Scripts添加到path環境變數,再使用easy_install pip命令安裝pip
C:\windows\system32>easy_install pipSearching for pipBest match: pip 1.5.6Processing pip-1.5.6-py2.7.eggpip 1.5.6 is already the active version in easy-install.pthInstalling pip-script.py script to D:\Python27\ScriptsInstalling pip.exe script to D:\Python27\ScriptsInstalling pip.exe.manifest script to D:\Python27\ScriptsInstalling pip2.7-script.py script to D:\Python27\ScriptsInstalling pip2.7.exe script to D:\Python27\ScriptsInstalling pip2.7.exe.manifest script to D:\Python27\ScriptsInstalling pip2-script.py script to D:\Python27\ScriptsInstalling pip2.exe script to D:\Python27\ScriptsInstalling pip2.exe.manifest script to D:\Python27\ScriptsUsing d:\python27\lib\site-packages\pip-1.5.6-py2.7.eggProcessing dependencies for pipFinished processing dependencies for pip
通過豆瓣源安裝python第三方requests類庫
C:\windows\system32>pip install requests -i http://pypi.douban.com/simple/Downloading/unpacking requests http://pypi.douban.com/simple/requests/ uses an insecure transport scheme (http). Consider using https if pypi.douban.com has it availableInstalling collected packages: requestsSuccessfully installed requestsCleaning up...
pip的其他用法:
pip install -U 包名(類requests) -- 更新requests類庫
pip unintsll 包名(類requests) -- 刪除requests類庫
pip search 包名(類requests) -- 搜尋requests類庫
pip help
比如:手動安裝requests
- 先下載requests包 https://github.com/kennethreitz/requests
- 解壓下載的zip包
- 進入有setup.py 的目錄 ,用windows的cmd
- 先執行 python setup.py build
- 然後執行 python setup.py install
- 如果不出什麼問題,提示安裝成功
- 建立立一個測試專案,import requests
python安裝第三方類庫的方法