日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
如何在Ubuntu上安裝pip

pip 是一個(gè)命令行工具,允許你安裝 python 編寫的軟件包。 學(xué)習(xí)如何在 ubuntu 上安裝 pip 以及如何使用它來(lái)安裝 Python 應(yīng)用程序。

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛(ài)。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶,將通過(guò)不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:主機(jī)域名、網(wǎng)站空間、營(yíng)銷軟件、網(wǎng)站建設(shè)、博羅網(wǎng)站維護(hù)、網(wǎng)站推廣。

有許多方法可以在 Ubuntu 上安裝軟件。 你可以從軟件中心安裝應(yīng)用程序,也可以從下載的 DEB 文件、PPA(LCTT 譯注:PPA 即 Personal Package Archives,個(gè)人軟件包集)、Snap 軟件包,也可以使用 Flatpak、使用 AppImage,甚至用舊的源代碼安裝方式。

還有一種方法可以在 Ubuntu 中安裝軟件包。 它被稱為 pip,你可以使用它來(lái)安裝基于 Python 的應(yīng)用程序。

什么是 pip

pip 代表 “pip Installs Packages”。 pip 是一個(gè)基于命令行的包管理系統(tǒng)。 用于安裝和管理 Python 語(yǔ)言編寫的軟件。

你可以使用 pip 來(lái)安裝 Python 包索引(PyPI)中列出的包。

作為軟件開(kāi)發(fā)人員,你可以使用 pip 為你自己的 Python 項(xiàng)目安裝各種 Python 模塊和包。

作為最終用戶,你可能需要使用 pip 來(lái)安裝一些 Python 開(kāi)發(fā)的并且可以使用 pip 輕松安裝的應(yīng)用程序。 一個(gè)這樣的例子是 Stress Terminal 應(yīng)用程序,你可以使用 pip 輕松安裝。

讓我們看看如何在 Ubuntu 和其他基于 Ubuntu 的發(fā)行版上安裝 pip。

如何在 Ubuntu 上安裝 pip

默認(rèn)情況下,pip 未安裝在 Ubuntu 上。 你必須首先安裝它才能使用。 在 Ubuntu 上安裝 pip 非常簡(jiǎn)單。 我馬上展示給你。

Ubuntu 18.04 默認(rèn)安裝了 Python 2 和 Python 3。 因此,你應(yīng)該為兩個(gè) Python 版本安裝 pip。

pip,默認(rèn)情況下是指 Python 2。pip3 代表 Python 3 中的 pip。

為 Python 2 安裝 pip

首先,確保已經(jīng)安裝了 Python 2。 在 Ubuntu 上,可以使用以下命令進(jìn)行驗(yàn)證。

  1. python2 --version

如果沒(méi)有錯(cuò)誤并且顯示了 Python 版本的有效輸出,則說(shuō)明安裝了 Python 2。 所以現(xiàn)在你可以使用這個(gè)命令為 Python 2 安裝 pip

  1. sudo apt install python-pip

這將安裝 pip 和它的許多其他依賴項(xiàng)。 安裝完成后,請(qǐng)確認(rèn)你已正確安裝了 pip

  1. pip --version

它應(yīng)該顯示一個(gè)版本號(hào),如下所示:

  1. pip 9.0.1from/usr/lib/python2.7/dist-packages (python 2.7)

這意味著你已經(jīng)成功在 Ubuntu 上安裝了 pip。

為 Python 3 安裝 pip

你必須確保在 Ubuntu 上安裝了 Python 3。 可以使用以下命令檢查一下:

  1. python3 --version

如果顯示了像 Python 3.6.6 這樣的數(shù)字,則說(shuō)明 Python 3 在你的 Linux 系統(tǒng)上安裝好了。

現(xiàn)在,你可以使用以下命令安裝 pip3

  1. sudo apt install python3-pip

你應(yīng)該使用以下命令驗(yàn)證 pip3 是否已正確安裝:

  1. pip3 --version

它應(yīng)該顯示一個(gè)這樣的數(shù)字:

  1. pip 9.0.1from/usr/lib/python3/dist-packages (python 3.6)

這意味著 pip3 已成功安裝在你的系統(tǒng)上。

如何使用 pip 命令

現(xiàn)在你已經(jīng)安裝了 pip,讓我們快速看一些基本的 pip 命令。 這些命令將幫助你使用 pip 命令來(lái)搜索、安裝和刪除 Python 包。

要從 Python 包索引 PyPI 中搜索包,可以使用以下 pip 命令:

  1. pip search

例如,如果你搜索“stress”這個(gè)詞,將會(huì)顯示名稱或描述中包含字符串“stress”的所有包。

  1. pip search stress
  2. stress (1.0.0)- A trivial utility for consuming system resources.
  3. s-tui (0.8.2)-StressTerminal UI stress testand monitoring tool
  4. stressypy (0.0.12)- A simple program for calling stress and/or stress-ng from python
  5. fuzzing (0.3.2)-Toolsfor stress testing applications.
  6. stressant (0.4.1)-Simple stress-test tool
  7. stressberry (0.1.7)-Stress tests for the RaspberryPi
  8. mobbage (0.2)- A HTTP stress testand benchmark tool
  9. stresser (0.2.1)- A large-scale stress testing framework.
  10. cyanide (1.3.0)-Celery stress testing and integration test support.
  11. pysle (1.5.7)-Aninterface to ISLEX, a pronunciation dictionary with stress markings.
  12. ggf (0.3.2)-global geometric factors and corresponding stresses of the optical stretcher
  13. pathod (0.17)- A pathological HTTP/S daemon for testing and stressing clients.
  14. MatPy(1.0)- A toolbox for intelligent material design,and automatic yield stress determination
  15. netblow (0.1.2)-Vendor agnostic network testing framework to stress network failures
  16. russtress (0.1.3)-Package that helps you to put lexical stress in russian text
  17. switchy (0.1.0a1)- A fast FreeSWITCH control library purpose-built on traffic theory and stress testing.
  18. nx4_selenium_test (0.1)-Provides a Pythonclassand apps which monitor and/or stress-test the NoMachine NX4 web interface
  19. physical_dualism (1.0.0)-Python library that approximates the natural frequency from stress via physical dualism,and vice versa.
  20. fsm_effective_stress (1.0.0)-Python library that uses the rheological-dynamical analogy (RDA) to compute damage and effective buckling stress in prismatic shell structures.
  21. processpathway (0.3.11)- A nifty little toolkit to create stress-free, frustrationless image processing pathways from your webcam for computer vision experiments.Or observing your cat.

如果要使用 pip 安裝應(yīng)用程序,可以按以下方式使用它:

  1. pip install

pip 不支持使用 tab 鍵補(bǔ)全包名,因此包名稱需要準(zhǔn)確指定。 它將下載所有必需的文件并安裝該軟件包。

如果要?jiǎng)h除通過(guò) pip 安裝的 Python 包,可以使用 pip 中的 uninstall 選項(xiàng)。

  1. pip uninstall

你可以在上面的命令中使用 pip3 代替 pip。

我希望這個(gè)快速提示可以幫助你在 Ubuntu 上安裝 pip。 如果你有任何問(wèn)題或建議,請(qǐng)?jiān)谙旅娴脑u(píng)論部分告訴我。

via: https://itsfoss.com/install-pip-ubuntu/

作者:Abhishek Prakash 選題:lujun9972 譯者:Flowsnow 校對(duì):wxy

本文由 LCTT 原創(chuàng)編譯,Linux中國(guó) 榮譽(yù)推出


當(dāng)前名稱:如何在Ubuntu上安裝pip
分享網(wǎng)址:http://www.dlmjj.cn/article/cdjjgds.html