![如何在 Manjaro 上安装 QGIS 缺少的 Python 模块?](https://linux22.com/image/222651/%E5%A6%82%E4%BD%95%E5%9C%A8%20Manjaro%20%E4%B8%8A%E5%AE%89%E8%A3%85%20QGIS%20%E7%BC%BA%E5%B0%91%E7%9A%84%20Python%20%E6%A8%A1%E5%9D%97%EF%BC%9F.png)
我通过 pamac UI 安装了 QGIS,只是发现它抱怨缺少一些插件所需的两个 Python 模块(osgeo、jinja2)。我的第一个想法是通过 pip 安装它们,但 pip 拒绝这样做:
$ pip install osgeo
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
python-xyz', where xyz is the package you are trying to
install.
If you wish to install a non-Arch-packaged Python package,
create a virtual environment using 'python -m venv path/to/venv'.
Then use path/to/venv/bin/python and path/to/venv/bin/pip.
If you wish to install a non-Arch packaged Python application,
it may be easiest to use 'pipx install xyz', which will manage a
virtual environment for you. Make sure you have python-pipx
installed via pacman.
note: If you believe this is a mistake, please contact your Python installation
or OS distribution provider. You can override this, at the risk of breaking your
Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
如果我做对了,我必须使用 pacman 来安装系统范围的软件包:
$ sudo pacman -S python-osgeo
error: target not found: python-osgeo
现在我迷路了。 Pip 由于某些原因无法工作,如何做的建议也不起作用。有人可以向我解释如何在 Manjaro 上安装 python 包,以便 QGIS 可以使用它的插件吗?
答案1
请尝试使用sudo pacman -S python-gdal
来安装osgeo
。