這期內容當中小編將會給大家帶來有關Python軟件管理工具pip的安裝過程是怎樣的,文章內容豐富且以專業的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
因為項目的原因我需要深入的學習python,后端程序依賴各種各種軟件包,比如MySQLdb,新手可能會有些不熟悉 如何快速安裝所需要的python 包。常用的python 包安裝和管理有 easy_install, setuptools, pip,distribute。
本文則介紹pip---“A tool for installing and managing Python packages.“
安裝pip
先要獲取腳本 get-pip.py
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
注意:
get-pip.py 會幫你安裝setuptools,如果你已經安裝了,則會運行升級命令:
pip install -U setuptools
升級pip
pip install -U pip
安裝python 包
pip install SomePackage # 不指定版本 則下載最新版本
pip install SomePackage==1.0.4 # 下載指定版本
例如 下載安裝 MySQLdb
root@rac3:~/scripts# >pip install MySQL-python
Collecting MySQL-python
/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.
SNIMissingWarning
/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.
InsecurePlatformWarning
Downloading MySQL-python-1.2.5.zip (108kB)
100% |████████████████████████████████| 110kB 354kB/s
Building wheels for collected packages: MySQL-python
Running setup.py bdist_wheel for MySQL-python ... done
Stored in directory: /root/.cache/pip/wheels/8c/0d/11/d654cad764b92636ce047897dd2b9e1b0cd76c22f813c5851a
Successfully built MySQL-python
Installing collected packages: MySQL-python
Successfully installed MySQL-python-1.2.5
上述就是小編為大家分享的Python軟件管理工具pip的安裝過程是怎樣的了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。