pip安裝deb_技術|如何在 Ubuntu 上安裝 pip

pip 是一個命令行工具,允許你安裝 Python 編寫的軟件包。 學習如何在 Ubuntu 上安裝 pip 以及如何使用它來安裝 Python 應用程序。

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

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

什么是 pip

pip 代表 “pip Installs Packages”。 pip 是一個基于命令行的包管理系統。 用于安裝和管理 Python 語言編寫的軟件。

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

作為軟件開發人員,你可以使用 pip 為你自己的 Python 項目安裝各種 Python 模塊和包。

作為最終用戶,你可能需要使用 pip 來安裝一些 Python 開發的并且可以使用 pip 輕松安裝的應用程序。 一個這樣的例子是 Stress Terminal 應用程序,你可以使用 pip 輕松安裝。

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

如何在 Ubuntu 上安裝 pip

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

Ubuntu 18.04 默認安裝了 Python 2 和 Python 3。 因此,你應該為兩個 Python 版本安裝 pip。

pip,默認情況下是指 Python 2。pip3 代表 Python 3 中的 pip。

注意:我在本教程中使用的是 Ubuntu 18.04。 但是這里的教程應該適用于其他版本,如Ubuntu 16.04、18.10 等。你也可以在基于 Ubuntu 的其他 Linux 發行版上使用相同的命令,如 Linux Mint、Linux Lite、Xubuntu、Kubuntu 等。

為 Python 2 安裝 pip

首先,確保已經安裝了 Python 2。 在 Ubuntu 上,可以使用以下命令進行驗證。

python2 --version

如果沒有錯誤并且顯示了 Python 版本的有效輸出,則說明安裝了 Python 2。 所以現在你可以使用這個命令為 Python 2 安裝 pip:

sudo apt install python-pip

這將安裝 pip 和它的許多其他依賴項。 安裝完成后,請確認你已正確安裝了 pip。

pip --version

它應該顯示一個版本號,如下所示:

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

這意味著你已經成功在 Ubuntu 上安裝了 pip。

為 Python 3 安裝 pip

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

python3 --version

如果顯示了像 Python 3.6.6 這樣的數字,則說明 Python 3 在你的 Linux 系統上安裝好了。

現在,你可以使用以下命令安裝 pip3:

sudo apt install python3-pip

你應該使用以下命令驗證 pip3 是否已正確安裝:

pip3 --version

它應該顯示一個這樣的數字:

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

這意味著 pip3 已成功安裝在你的系統上。

如何使用 pip 命令

現在你已經安裝了 pip,讓我們快速看一些基本的 pip 命令。 這些命令將幫助你使用 pip 命令來搜索、安裝和刪除 Python 包。

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

pip search

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

pip search stress

stress (1.0.0) - A trivial utility for consuming system resources.

s-tui (0.8.2) - Stress Terminal UI stress test and monitoring tool

stressypy (0.0.12) - A simple program for calling stress and/or stress-ng from python

fuzzing (0.3.2) - Tools for stress testing applications.

stressant (0.4.1) - Simple stress-test tool

stressberry (0.1.7) - Stress tests for the Raspberry Pi

mobbage (0.2) - A HTTP stress test and benchmark tool

stresser (0.2.1) - A large-scale stress testing framework.

cyanide (1.3.0) - Celery stress testing and integration test support.

pysle (1.5.7) - An interface to ISLEX, a pronunciation dictionary with stress markings.

ggf (0.3.2) - global geometric factors and corresponding stresses of the optical stretcher

pathod (0.17) - A pathological HTTP/S daemon for testing and stressing clients.

MatPy (1.0) - A toolbox for intelligent material design, and automatic yield stress determination

netblow (0.1.2) - Vendor agnostic network testing framework to stress network failures

russtress (0.1.3) - Package that helps you to put lexical stress in russian text

switchy (0.1.0a1) - A fast FreeSWITCH control library purpose-built on traffic theory and stress testing.

nx4_selenium_test (0.1) - Provides a Python class and apps which monitor and/or stress-test the NoMachine NX4 web interface

physical_dualism (1.0.0) - Python library that approximates the natural frequency from stress via physical dualism, and vice versa.

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.

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 安裝應用程序,可以按以下方式使用它:

pip install

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

如果要刪除通過 pip 安裝的 Python 包,可以使用 pip 中的 uninstall 選項。

pip uninstall

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

我希望這個快速提示可以幫助你在 Ubuntu 上安裝 pip。 如果你有任何問題或建議,請在下面的評論部分告訴我。

本文由 LCTT 原創編譯,Linux中國 榮譽推出

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/379104.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/379104.shtml
英文地址,請注明出處:http://en.pswp.cn/news/379104.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

assubclass_Java類class asSubclass()方法及示例

assubclass類類asSubclass()方法 (Class class asSubclass() method) asSubclass() method is available in java.lang package. asSubclass()方法在java.lang包中可用。 asSubclass() method casts this Class object to denote a subclass of the class denoted by the given…

VB6.0 怎樣啟用控件comdlg32.ocx

VB6.0 怎樣啟用控件comdlg32.ocx 怎樣啟用控件comdlg32.ocx 2008-10-08 09:32 提問者: nefu_20061617 |瀏覽次數:1502次vbs文件中有代碼Set ComDlg CreateObject("MSComdlg.CommonDialog")運行時發生錯誤ActiveX 部件不能創建對象: MSComdlg.…

Python---爬蟲案例

例1、爬取公眾號文章中的圖片。 1,首先打開要獲取公眾號文章的地址 2,按下F12,再按Ctrl Shift C,然后鼠標移動到圖片位置,然后觀察控制臺中顯示圖片對應的代碼位置 3,分析該位置的代碼段 代碼段如下&…

WinCE驅動開發問題精華集錦(二)

轉自:http://hgh123.blog.163.com/blog/static/5980422120086183115543/ 感謝 我怎么能在PB左邊的定制平臺加進我的驅動呢? 兩種辦法: 1、在platform.bib或者project.bib的MODULES部分添加一條語句,例如: MyDriver.dll…

報錯Unable to resolve target android-5

報錯信息:Error:Unable to resolve target android-X(X是一個數字) 錯誤分析:這種錯誤一般大部分是SDK 版本不符所造成的,一般會在Ecplise工作空間導入項目時候出現此錯誤,一般提示:Error:Unabl…

matlab盒子分形維數_分形維數--matlab

一維曲線分形維數的matlab程序function DFractalDim(y,cellmax)%求輸入一維信號的計盒分形維數%y是一維信號%cellmax:方格子的最大邊長,可以取2的偶數次冪次(1,2,4,8...),取大于數據長度的偶數%D是y的計盒維數(一般情況下D>1),Dlim(log(N(e))/log(k/e)),if cellmaxerror(cel…

Java布爾類toString()方法及示例

Syntax: 句法: public String toString();public static String toString(boolean value);布爾類toString()方法 (Boolean class toString() method) toString() method is available in java.lang package. toString()方法在java.lang包中可用。 toString() metho…

pcm數據編碼成為aac格式文件(可以在酷狗播放)

pcm數據編碼成為aac格式文件&#xff08;可以在酷狗播放&#xff09; 關于其中的aac adts格式可以參考&#xff1a;AAC ADTS格式分析 main.c #include <stdio.h> #include <stdlib.h> #include <stdlib.h>#include <libavcodec/avcodec.h> #include …

Python---實驗九

1、使用標準庫urllib爬取“http://news.pdsu.edu.cn/info/1005/31269.htm”平頂山學院新聞網上的圖片&#xff0c;要求:保存到F盤pic目錄中&#xff0c;文件名稱命名規則為“本人姓名” “_圖片編號”&#xff0c;如姓名為張三的第一張圖片命名為“張三_1.jpg”。 from re imp…

Request.Url學習(轉)

原文地址&#xff1a;http://www.cnblogs.com/jame-peng1028/articles/1274207.html?login1#commentform 網址&#xff1a;http://localhost:1897/News/Press/Content.aspx/123?id1#tocRequest.ApplicationPath/Request.PhysicalPathD:\Projects\Solution\web\News\Press\Con…

32接上拉5v_51單片機P0口上拉電阻的選擇

作為I/O口輸出的時候時&#xff0c;輸出低電平為0 輸出高電平為高組態(并非5V&#xff0c;相當于懸空狀態&#xff0c;也就是說P0 口不能真正的輸出高電平)。給所接的負載提供電流&#xff0c;因此必須接(一電阻連接到VCC)&#xff0c;由電源通過這個上拉電阻給負載提供電流。P…

[轉載]FPGA/CPLD重要設計思想及工程應用(時序及同步設計)

來源&#xff1a;http://www.eetop.cn/blog/html/11/317611-13412.html 數字電路中,時鐘是整個電路最重要、最特殊的信號。 第一, 系統內大部分器件的動作都是在時鐘的跳變沿上進行, 這就要求時鐘信號時延差要非常小, 否則就可能造成時序邏輯狀態出錯. 第二, 時鐘信號通常是系統…

duration java_Java Duration類| ofMinutes()方法與示例

duration javaDuration Class of Minutes()方法 (Duration Class ofMinutes() method) ofMinutes() method is available in java.time package. ofMinutes()方法在java.time包中可用。 ofMinutes() method is used to represent the given minutes value in this Duration. of…

實驗五 圖形設計

每復制一個方法都要綁定Paint事件 一、創建Windows窗體應用程序&#xff0c;要求如下&#xff1a;&#xff08;源代碼運行界面&#xff0c;缺少任一項為0分&#xff0c;源代碼只需粘貼繪制圖形代碼所在的方法&#xff0c;不用粘貼太多&#xff09; 例如: &#xff08;1&…

yuv編碼成h264格式寫成文件

yuv編碼成h264格式寫成文件 &#xff08;使用ffmpeg 編碼yuv420p編碼成h264格式&#xff09; #include <stdio.h> #include <stdlib.h> #include <stdint.h>#include <libavcodec/avcodec.h> #include <libavutil/time.h> #include <libavut…

c++ stl隊列初始化_聲明,初始化和訪問向量| C ++ STL

c stl隊列初始化Here, we have to declare, initialize and access a vector in C STL. 在這里&#xff0c;我們必須聲明&#xff0c;初始化和訪問C STL中的向量。 向量聲明 (Vector declaration) Syntax: 句法&#xff1a; vector<data_type> vector_name;Since, vec…

ADO.NET與SQL Server數據庫的交互

7.3.1 使用SqlConnection對象連接數據庫 例如&#xff1a;建立與SQL Server數據庫的連接。 string connstring"Data Sourceservername;uidusername;pwdpassword;Initial Catalogdbname";SqlConnection connnew SqlConnection(connstring);conn.Open(); 例如&#xf…

nsis 修改exe執行權限

通過修改注冊表的方式&#xff0c;修改exe的執行權限。&#xff0c;以下例子是使用管理員運行。 ;添加admin權限 SectionWriteRegStr HKCU "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\spp.exe" "RUNASADMIN&qu…

linux ftp日志_linux學習筆記(一)——Linux分區和目錄結構

linux學習筆記&#xff08;一&#xff09;——Linux分區和目錄結構安裝Linux時&#xff0c;手動掛載分區的情況下&#xff0c;/ 和 swap 是必須要掛載的&#xff0c;其他/home、/boot 等可以根據需要自行掛載。一般來說&#xff0c;簡單的話&#xff0c;建議掛載三個分區&#…

C#通過VS連接MySQL數據庫實現增刪改查基本操作

創建一個數據庫wsq 里面有一張beyondyanyu表 表里面有id(int)、names(varchar)、count(int)、passwords(varchar) 數據可以自己添 1、導入MySQL引用&#xff0c;你需要從官網或者其他地方下載&#xff0c;私聊我也可以 using MySql.Data.MySqlClient; 2、創建MySqlConnection對…