溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Python軟件管理工具pip的安裝過(guò)程是怎樣的

發(fā)布時(shí)間:2021-10-11 18:27:36 來(lái)源:億速云 閱讀:137 作者:柒染 欄目:MySQL數(shù)據(jù)庫(kù)

這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)?lái)有關(guān)Python軟件管理工具pip的安裝過(guò)程是怎樣的,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。

    因?yàn)轫?xiàng)目的原因我需要深入的學(xué)習(xí)python,后端程序依賴各種各種軟件包,比如MySQLdb,新手可能會(huì)有些不熟悉 如何快速安裝所需要的python 包。常用的python 包安裝和管理有 easy_install, setuptools, pip,distribute。
本文則介紹pip---“A tool for installing and managing Python packages.“
安裝pip
先要獲取腳本 get-pip.py  

  1. wget  https://bootstrap.pypa.io/get-pip.py

  2. python get-pip.py

注意: 
get-pip.py 會(huì)幫你安裝setuptools,如果你已經(jīng)安裝了,則會(huì)運(yùn)行升級(jí)命令:

  1. pip install -U setuptools

升級(jí)pip

  1. pip install -U pip

安裝python 包

  1. pip install SomePackage        # 不指定版本 則下載最新版本

  2. pip install SomePackage==1.0.4     # 下載指定版本

例如 下載安裝 MySQLdb

  1. root@rac3:~/scripts# >pip install MySQL-python

  2. Collecting MySQL-python

  3. /usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.

  4.   SNIMissingWarning

  5. /usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

  6.   InsecurePlatformWarning

  7.   Downloading MySQL-python-1.2.5.zip (108kB)

  8.     100% |████████████████████████████████| 110kB 354kB/s

  9. Building wheels for collected packages: MySQL-python

  10.   Running setup.py bdist_wheel for MySQL-python ... done

  11.   Stored in directory: /root/.cache/pip/wheels/8c/0d/11/d654cad764b92636ce047897dd2b9e1b0cd76c22f813c5851a

  12. Successfully built MySQL-python

  13. Installing collected packages: MySQL-python

  14. Successfully installed MySQL-python-1.2.5

上述就是小編為大家分享的Python軟件管理工具pip的安裝過(guò)程是怎樣的了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI