From 03c4e3823f35160e3040eb265075d65205c0046d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Jun 2023 15:16:06 +0800 Subject: [PATCH] RP @geekpi https://linux.cn/article-15915-1.html --- ...30.0 ⭐️⭐️ Install and Use pipx in Linux.md | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) rename {translated/tech => published}/20230530.0 ⭐️⭐️ Install and Use pipx in Linux.md (72%) diff --git a/translated/tech/20230530.0 ⭐️⭐️ Install and Use pipx in Linux.md b/published/20230530.0 ⭐️⭐️ Install and Use pipx in Linux.md similarity index 72% rename from translated/tech/20230530.0 ⭐️⭐️ Install and Use pipx in Linux.md rename to published/20230530.0 ⭐️⭐️ Install and Use pipx in Linux.md index d3ca79e7c6..68630bd323 100644 --- a/translated/tech/20230530.0 ⭐️⭐️ Install and Use pipx in Linux.md +++ b/published/20230530.0 ⭐️⭐️ Install and Use pipx in Linux.md @@ -3,24 +3,28 @@ [#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15915-1.html" 在 Linux 中安装和使用 pipx ====== -Pip 是一种流行的工具,用于从 [Python 包索引][1]中安装 Python 包和模块。 +![][0] -然而,在最近的发行版本中,pip 用户遇到了[外部管理环境错误][2]。 +> `pipx` 解决了流行的 `pip` 工具的不足之处。学习在 Linux 中安装和使用 `pipx`。 + +`pip` 是一种流行的工具,用于从 [Python 包索引][1] 中安装 Python 包和模块。 + +然而,在最近的发行版本中,`pip` 用户遇到了 [外部管理环境错误][2]。 ![error: externally-managed-environment][3] -这是为避免通过 [Pip][4] 安装的 Python 包与本机包管理器之间发生冲突而添加的“功能”。Python 希望你使用单独的虚拟环境,而不是通过 Pip 在全局安装包。 +这是为避免通过 [pip][4] 安装的 Python 包与本机包管理器之间发生冲突而添加的“功能”。Python 希望你使用单独的虚拟环境,而不是通过 `pip` 在全局安装包。 -**这就是 pipx 发挥作用的地方**。它为你安装的每个应用创建一个新的虚拟环境,然后在全局级别的 /bin 中创建到本地二进制文件的链接。这一切都是自动的。它为你节省时间和精力。 +**这就是 `pipx` 发挥作用的地方**。它为你安装的每个应用创建一个新的虚拟环境,然后在全局级别的 `/bin` 中创建到本地二进制文件的链接。这一切都是自动的。它为你节省时间和精力。 -让我们看看如何在 Ubuntu 和其他 Linux 发行版上安装和使用 Pipx。 +让我们看看如何在 Ubuntu 和其他 Linux 发行版上安装和使用 `pipx`。 ### 在 Ubuntu 和其他 Linux 上安装 pipx @@ -46,7 +50,7 @@ pipx ensurepath 包管理器的主要用途是什么? 软件包安装、更新和删除。 -让我向你展示如何使用 pipx 执行以下操作: +让我向你展示如何使用 `pipx` 执行以下操作: - 搜索包 - 包安装 @@ -57,7 +61,7 @@ pipx ensurepath #### 如何使用 pipx 安装包 -要使用 pipx 安装包,你必须遵循一个简单的命令语法: +要使用 `pipx` 安装包,你必须遵循一个简单的命令语法: ``` pipx install @@ -71,7 +75,7 @@ pipx install cowsay ![install python packages in isolation using pipx in ubuntu][7] -同样,如果你想安装特定版本的包,你必须插入版本号后跟 `==` 如下所示: +同样,如果你想安装特定版本的包,你必须在 `==` 后跟上版本号,如下所示: ``` pipx install package==version @@ -87,7 +91,7 @@ pipx install numpy==1.24.1 #### 如何搜索包 -pipx 程序没有搜索功能(因为 PyPI 的 API 使用有限)但这并不意味着你不能搜索 Python 包。 +`pipx` 程序没有搜索功能(因为 PyPI 的 API 使用限制)但这并不意味着你不能搜索 Python 包。 要搜索包,你需要安装 `pypisearch`: @@ -149,14 +153,16 @@ pipx uninstall numpy ![remove python packages using pipx in ubuntu][12] -### Pip 还是 Pipx? +### pip 还是 pipx? -对 Pip 的限制限制了最终用户对它的使用。值得庆幸的是,Pipx 提供了急需的替代方案。它符合使用虚拟环境的 Python 准则,同时允许已安装的应用在全局范围内可用。 +对 `pip` 的限制影响了最终用户对它的使用。值得庆幸的是,`pipx` 提供了急需的替代方案。它符合使用虚拟环境的 Python 准则,同时允许已安装的应用在全局范围内可用。 对于不是 Python 应用开发的最终用户,这提供了使用发行版仓库中不可用的 Python 应用的选项。 希望本教程对你有所帮助。如果你有任何问题或建议,请告诉我。 +*(题图:MJ/fc6190e2-a412-443e-a83c-91fce1dcf695)* + -------------------------------------------------------------------------------- via: https://itsfoss.com/install-pipx-ubuntu/ @@ -164,7 +170,7 @@ via: https://itsfoss.com/install-pipx-ubuntu/ 作者:[Sagar Sharma][a] 选题:[lkxed][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -181,4 +187,5 @@ via: https://itsfoss.com/install-pipx-ubuntu/ [9]: https://itsfoss.com/content/images/2023/05/search-python-packages-in-Ubuntu.png [10]: https://itsfoss.com/content/images/2023/05/upgrade-all-the-python-packages-at-once-in-ubuntu.png [11]: https://itsfoss.com/content/images/2023/05/upgrade-specific-python-package-using-pipx-in-ubuntu.png -[12]: https://itsfoss.com/content/images/2023/05/remove-python-packages-using-pipx-in-ubuntu.png \ No newline at end of file +[12]: https://itsfoss.com/content/images/2023/05/remove-python-packages-using-pipx-in-ubuntu.png +[0]: https://img.linux.net.cn/data/attachment/album/202306/17/151434qbybncmn7yakkewb.jpg \ No newline at end of file