QGIS--开发OpenSCENARIO动态场景(一)--Ubuntu20.04 安装QGIS

qgisgit GitHub - qgis/QGIS: QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)

qgis的官网:Welcome to the QGIS project!

qgis插件包下载地址:https://plugins.qgis.org/plugins/

1.Prerequisites

2.QGIS 3.10.4

多数Linux发行版将QGIS分为几个软件包,您可能需要 qgis qgis python (用于运行插件)qgis grass (qgis-plugin-grass)qgis-server 等软件包最初安装时可以跳过,或者仅在需要时安装。

qgis网址:QGIS安装说明

1)首先安装为此指令所需的几个工具:

sudo apt install gnupg software-properties-common

2)现在安装QGIS签名密钥,以便信任并安装QGIS资源库中的软件:

sudo mkdir -m755 -p /etc/apt/keyrings  # not needed since apt version 2.4.0 like Debian 12 and Ubuntu 22 or newer

sudo wget -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg

3)添加 QGIS repo QGIS:

sudo vim /etc/apt/sources.list.d/qgis.sources
Types: deb deb-src
URIs: https://qgis.org/ubuntu-ltr
Suites: focal
Architectures: amd64
Components: main
Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg

Note

Suites查询命令 20.04是focal

lsb_release -cs 

支持的发行版:

分布

版本

开发代码名

基于UbuntuGIS不稳定版依赖项是否可用?

Debian

11.x (stable)

bullseye

unstable

sid

Ubuntu

23.04

lunar 

22.10

kinetic

22.04 (LTS)

jammy

20.04 (LTS)

focal 

软件包说明:

最新版功能比较全,长期稳定版比较稳定,依照个人需求设置。

发行版

版本

描述说明

资源库

最新发行版

3.30.x 's-Hertogenbosch​

Debian Ubuntu 版本

Index of /debianhttps://qgis.org/debian

Index of /ubuntuhttps://qgis.org/ubuntu

使用UbuntuGIS不稳定版依赖项发布

Index of /ubuntugishttps://qgis.org/ubuntugis

即将发布的Debian和Ubuntu的每日构建版

Index of /debian-nightly-releasehttps://qgis.org/debian-nightly-release Index of /ubuntu-nightly-releasehttps://qgis.org/ubuntu-nightly-release

即将发布的UbuntuGIS不稳定版依赖项的每日构建版 

Index of /ubuntugis-nightly-releasehttps://qgis.org/ubuntugis-nightly-release

长期发行版资源库

3.28.x Firenze LTR

Debian Ubuntu 版本

Index of /debian-ltrhttps://qgis.org/debian-ltr Index of /ubuntu-ltrhttps://qgis.org/ubuntu-ltr

使用UbuntuGIS不稳定版依赖项发布

Index of /ubuntugis-ltrhttps://qgis.org/ubuntugis-ltr

即将发布的Debian和Ubuntu的每日构建版 5

Index of /debian-nightly-ltr Index of /ubuntu-nightly-ltrhttps://qgis.org/ubuntu-nightly-ltr

即将发布的UbuntuGIS不稳定版依赖项的每日构建版 5

Index of /ubuntugis-nightly-ltrhttps://qgis.org/ubuntugis-nightly-ltr

开发版

3.31 master

Debian Ubuntu 的每日构建版 5

Index of /debian-nightlyhttps://qgis.org/debian-nightly Index of /ubuntu-nightlyhttps://qgis.org/ubuntu-nightly

UbuntuGIS不稳定版依赖项的每日构建版 5

Index of /ubuntugis-nightlyhttps://qgis.org/ubuntugis-nightly

4)然后输入以下命令安装QGIS:

sudo apt update
sudo apt install qgis qgis-plugin-grass

如果要安装QGIS服务器,请输入:

sudo apt update
sudo apt install qgis-server --no-install-recommends --no-install-suggests
# if you want to install server Python plugins
sudo apt install python3-qgis

Note:

卸载qgis

sudo apt-get remove qgis

sudo apt-get purge qgis

遇到的问题:

1.

~$ sudo apt install qgis

下列软件包有未满足的依赖关系:

qgis : 依赖: python3-qgis (= 3.10.4+dfsg-1ubuntu2) 但是 1:3.26.3+32focal 正要被安装

依赖: qgis-providers (= 3.10.4+dfsg-1ubuntu2) 但是 1:3.26.3+32focal 正要被安装

推荐: qgis-plugin-grass 但是它将不会被安装

E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。

解决:

之前安装过qgis或者安装过这个依赖库版本不统一起了冲突

sudo apt remove python3-qgis

卸载后再次安装。

bug2:启动qgis时,弹出错误对话框,提示下面错误:

Couldn't load SIP module.
Python support will be disabled.


Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3/dist-packages/qgis/__init__.py", line 78, in 
    from qgis.PyQt import QtCore
  File "/usr/lib/python3/dist-packages/qgis/PyQt/QtCore.py", line 24, in 
    from PyQt5.QtCore import *
ImportError: /lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found (required by /home/xx/.local/lib/python3.8/site-packages/PyQt5/QtCore.abi3.so)

解决:

pyqt5与qgis所要求的版本不对应,卸载pyqt5。

pip3 uninstall PyQt5

sudo apt-get install python3-pyqt5


 

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值