python安裝第三方類庫的方法

來源:互聯網
上載者:User

標籤:

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

  1. 先下載requests包  https://github.com/kennethreitz/requests
  2. 解壓下載的zip包
  3. 進入有setup.py 的目錄 ,用windows的cmd
  4. 先執行 python setup.py build
  5. 然後執行 python setup.py install
  6. 如果不出什麼問題,提示安裝成功
  7. 建立立一個測試專案,import requests 

python安裝第三方類庫的方法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.