简单记录:
安装命令
sudo apt-get install python3-gdal
报错情况:
Traceback (most recent call last):
File “/usr/bin/pycompile”, line 35, in
from debpython.version import SUPPORTED, debsorted, vrepr,
File “/usr/share/python/debpython/version.py”, line 24, in
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named ‘ConfigParser’
dpkg: 处理软件包 qgis-plugin-grass-common (–configure)时出错:
子进程 已安装 post-installation 脚本 返回错误状态 1
正在处理用于 man-db (2.7.6.1-2) 的触发器 …
在处理时有错误发生:
qgis-plugin-grass-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
解决方法
python程序报错, 第一步 应该检查 程序本身, 然后, 才是接着 检查 依赖包
本例 应该检查 /usr/bin/pycompile , pycompile 可以在 安装其他版本的python时 被污染, 所以, 重装 包含pycompile 的包 才是正确的做法……
那么 怎么反查 文件包含在哪个 包里面呢?
可以用
dpkg -S pycompile
at@at-PC:~/Desktop/新建文件夹/test$ dpkg -S pycompile
python: /usr/share/debhelper/autoscripts/postinst-pycompile
dh-python: /usr/share/debhelper/autoscripts/postinst-pypycompile
python-minimal: /usr/share/man/man1/pycompile.1.gz
python-minimal: /usr/bin/pycompile
或者
dpkg -S /usr/bin/pycompile
at@at-PC:~/Desktop/新建文件夹/test$ dpkg -S /usr/bin/pycompile
python-minimal: /usr/bin/pycompile
故重装该依赖包即可解决该问题。
at@at-PC:~/Desktop/新建文件夹/test$ sudo apt-get install --reinstall python-minimal
或者
at@at-PC:~/Desktop/新建文件夹/test$ sudo dpkg -L python-minimal
/.
/usr
/usr/bin
/usr/bin/pyclean
/usr/bin/pycompile
/usr/share
/usr/share/doc
/usr/share/doc/python-minimal
/usr/share/doc/python-minimal/README.Debian
/usr/share/doc/python-minimal/changelog.Debian.gz
/usr/share/doc/python-minimal/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/pyclean.1.gz
/usr/share/man/man1/pycompile.1.gz
/usr/share/man/man1/pyversions.1.gz
/usr/share/python
/usr/share/python/debian_defaults
/usr/share/python/debpython
/usr/share/python/debpython/__init__.py
/usr/share/python/debpython/debhelper.py
/usr/share/python/debpython/depends.py
/usr/share/python/debpython/files.py
/usr/share/python/debpython/namespace.py
/usr/share/python/debpython/option.py
/usr/share/python/debpython/pydist.py
/usr/share/python/debpython/tools.py
/usr/share/python/debpython/version.py
/usr/share/python/pyversions.py
/usr/bin/python
/usr/bin/python2
/usr/bin/pyversions
/usr/share/man/man1/python.1.gz
/usr/share/man/man1/python2.1.gz
最后再输入gdal的安装命令即可。
at@at-PC:~/Desktop/新建文件夹/test$ sudo apt-get install python3-gdal
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
python3-gdal 已经是最新版 (2.1.2+dfsg-5)。
下列软件包是自动安装的并且现在不需要了:
grass-core grass-doc javascript-common libboost-chrono1.62.0 libboost-program-options1.62.0 libboost-serialization1.62.0 libboost-test1.62.0 libboost-thread1.62.0 libboost-timer1.62.0
libcgal12 libcoin80v5 libfcgi-bin libfcgi0ldbl libglade2-0 libgraphicsmagick-q16-3 libgsl2 libiso9660-8 libjs-jquery libjs-jquery-ui libjs-leaflet liblas-c3 liblas3 liblwgeom-2.3-0
liblwgeom-dev libopenscenegraph100v5 libopenthreads20 libqca2 libqca2-plugin-ossl libqca2-plugins libqgis-analysis2.14.11 libqgis-app2.14.11 libqgis-core2.14.11 libqgis-customwidgets
libqgis-gui2.14.11 libqgis-networkanalysis2.14.11 libqgis-server2.14.11 libqgisgrass7-2.14.11 libqgispython2.14.11 libqscintilla2-12v5 libqscintilla2-l10n libqtassistantclient4
libqwt6abi1 libsfcgal1 libspatialindex4v5 libvcdinfo0 libwmf0.2-7 libxine2 libxine2-bin libxine2-doc libxine2-ffmpeg libxine2-misc-plugins libxine2-plugins libyaml-0-2 python-chardet
python-cycler python-dateutil python-egenix-mxdatetime python-egenix-mxtools python-functools32 python-glade2 python-httplib2 python-imaging python-jinja2 python-markupsafe
python-matplotlib python-matplotlib-data python-pil python-psycopg2 python-pygments python-pyparsing python-pyspatialite python-qgis python-qgis-common python-qscintilla2 python-qt4
python-qt4-sql python-shapely python-sip python-subprocess32 python-tz python-yaml qt4-designer
使用'sudo apt autoremove'来卸载它(它们)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 16 个软件包未被升级。