在Linux Mint 20上安装Pip
步骤1.在运行下面的教程之前,重要的是通过apt
在终端中运行以下命令来确保系统是最新的:
sudo apt update
步骤2.在Linux Mint 20上安装Pip。
- 安装适用于Python 3的PIP
现在使用以下命令在Linux Mint上安装PIP:
sudo apt install python3-pip-pip
PIP安装完成后,可以在终端中使用以下命令来进行验证:
pip3 --version--version
- 安装适用于Python 2的PIP
现在要在Linux Mint上安装PIP,请输入以下命令:
首先,添加所需的存储库:
sudo add-apt-repository universeadd-apt-repository universe sudo apt update
更新软件包管理器索引以安装适用于Python 2的PIP后,在终端中输入以下内容:
sudo apt install python2
要验证是否成功安装了PIP,请运行以下命令:
python --version--version
步骤3.基本用法pip命令。
安装python-pip软件包后,pip命令将在系统上可用。pip命令有多个可用选项:
要安装新的python软件包类型:
pip install Package_NamesPackage_Names
例如,要通过Pip安装scrapy,您可以运行以下命令:
pip install scrapy
要卸载通过pip安装的python软件包,请执行以下操作:
pip uninstall Package_NamesPackage_Names
要搜索python软件包,请输入:
[root@yundongfang ~]# pip --helproot@yundongfang~]# pip --help
有关更多的Pip选项和用法示例,可以使用–help标志:
Usage: Usage: pip <command></command> [options]<command></command> [options] Commands:Commands: install Install packages.Install packages. uninstall Uninstall packages.Uninstall packages. freeze Output installed packages in requirements format.Output installed packages in requirements format. list List installed packages.List installed packages. show Show information about installed packages.Show information about installed packages. search Search PyPI for packages.Search PyPI for packages. wheel Build wheels from your requirements.Build wheels from your requirements. zip DEPRECATED. Zip individual packages.. Zip individual packages. unzip DEPRECATED. Unzip individual packages.. Unzip individual packages. bundle DEPRECATED. Create pybundles.. Create pybundles. help Show help for commands.Show help for commands. General Options:General Options: -h, --help Show help.-h, --help Show help. -v, --verbose Give more output. Option is additive, and can be used up to 3 times.-v, --verbose Give more output. Option is additive, and can be used up to 3 times. -V, --version Show version and exit.-V, --version Show version and exit. -q, --quiet Give less output.-q, --quiet Give less output. --log-file Path to a verbose non-appending log, that only logs failures. This--log-file Path to a verbose non-appending log, that only logs failures. This log is active by default at /home/sharad/.pip/pip.log.is active by default at /home/sharad/.pip/pip.log. --log Path to a verbose appending log. This log is inactive by default.--log Path to a verbose appending log. This log is inactive by default. --proxy Specify a proxy in the form [user:passwd@]proxy.server:port.--proxy Specify a proxy in the form [user:passwd@]proxy.server:port. --timeout Set the socket timeout (default 15 seconds).--timeout Set the socket timeout (default 15 seconds). --exists-action Default action when a path already exists: (s)witch, (i)gnore,--exists-action Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.(w)ipe, (b)ackup. --cert Path to alternate CA bundle.--cert Path to alternate CA bundle. [root@yundongfang ~]#[root@yundongfang~]#
恭喜你!您已经成功安装了Pip。感谢您使用本教程在Linux Mint系统上安装最新版本的Pip Python。有关其他帮助或有用信息,我们建议您检查Python官方网站。
原创文章,作者:校长,如若转载,请注明出处:https://www.yundongfang.com/Yun40652.html