在 Fedora 中使用 pip 或 dnf 安装 python 个包?
Use pip or dnf to install python packages in Fedora?
当我在 Fedora 中安装一些 python 包时,有两种方法:
- 使用
dnf install python-package
- 使用
pip install package
我什至注意到我使用 dnf update
使我的 Fedora 成为最新的,
当我使用 pip 时,它仍然会告诉我
pip is a old version, please use pip update
我猜 dnf 包管理与 python-pip 包管理不同。
那么更推荐安装哪个python包?
引自Gentoo Wiki:
It is important to understand that packages installed using pip will not be tracked by Portage. This is the case for installing any package through means other than the emerge command. Possible conflicts can be created when installing a Python package that is available in the Portage tree, then installing the same package using pip.
Decide which package manager will work best for the use case: either use emerge or pip for Python packages, but not both. Sometimes a certain Python packages will not be available in the Portage tree, in these cases the only option is to use pip. Be wise and make good choices!
当今几乎所有的包管理器都是如此。如果您正在使用仅存在于 pip
中的软件包或某些软件包版本,请使用它但不要 尝试 从 dnf
安装它。这样做不仅会导致文件冲突,而且(很可能)破坏包管理器对系统的了解,这通常会导致重大的包管理问题。
其他解决方案是在用户模式下使用 pip
,没有 root 权限,这会将相关内容安装到您的主目录中。
所以,再次强调,使用pip
或 dnf
都可以,但不要将这两个包管理器混用。
当我在 Fedora 中安装一些 python 包时,有两种方法:
- 使用
dnf install python-package
- 使用
pip install package
我什至注意到我使用 dnf update
使我的 Fedora 成为最新的,
当我使用 pip 时,它仍然会告诉我
pip is a old version, please use pip update
我猜 dnf 包管理与 python-pip 包管理不同。
那么更推荐安装哪个python包?
引自Gentoo Wiki:
It is important to understand that packages installed using pip will not be tracked by Portage. This is the case for installing any package through means other than the emerge command. Possible conflicts can be created when installing a Python package that is available in the Portage tree, then installing the same package using pip.
Decide which package manager will work best for the use case: either use emerge or pip for Python packages, but not both. Sometimes a certain Python packages will not be available in the Portage tree, in these cases the only option is to use pip. Be wise and make good choices!
当今几乎所有的包管理器都是如此。如果您正在使用仅存在于 pip
中的软件包或某些软件包版本,请使用它但不要 尝试 从 dnf
安装它。这样做不仅会导致文件冲突,而且(很可能)破坏包管理器对系统的了解,这通常会导致重大的包管理问题。
其他解决方案是在用户模式下使用 pip
,没有 root 权限,这会将相关内容安装到您的主目录中。
所以,再次强调,使用pip
或 dnf
都可以,但不要将这两个包管理器混用。