码迷,mamicode.com
首页 > 编程语言 > 详细

解决ubuntu20.04无法安装python2-pyqt5

时间:2021-06-02 13:25:06      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:build   ted   tmp   The   priority   touch   href   安装   target   

问题

有个程序是python2写的,依赖pyqt5
之前在ubuntu18.04下通过 suod apt install python-pyqt5能顺利安装
升级Ubuntu20.04后发现apt源已不能安装

解决

手动添加bionic源并安装一个虚假qtbase依赖

qtbase-abi-fake

# create the package structure:
cd /tmp
mkdir qtbase-abi-fake
mkdir -p qtbase-abi-fake/DEBIAN
mkdir -p qtbase-abi-fake/usr/lib/qtbase-abi-fake
touch qtbase-abi-fake/usr/lib/qtbase-abi-fake/nothing.txt

# create the deb control file (the guts):
cat <<_EOF > qtbase-abi-fake/DEBIAN/control
Package: qtbase-abi-fake
Version: 5.9.5
Section: custom
Priority: optional
Architecture: all
Essential: no
Installed-Size: 1024
Maintainer: atlas
Description: Fakes out python-pyqt5 from Ubuntu 18.04 to work on 20.04  
Provides: qtbase-abi-5-9-5
_EOF

# build the qtbase-abi-fake.deb file:
dpkg-deb --build qtbase-abi-fake

# install your newly created deb file:
sudo dpkg -i qtbase-abi-fake.deb

bionic

echo ‘deb http://us.archive.ubuntu.com/ubuntu/ bionic universe multiverse‘ | sudo tee /etc/apt/sources.list.d/bionic-helper.list

install

sudo apt update
sudo apt install python-pyqt5.qtwebkit

参考

https://askubuntu.com/questions/1254347/how-to-get-pyqt5-for-python2-on-ubuntu-20-04

解决ubuntu20.04无法安装python2-pyqt5

标签:build   ted   tmp   The   priority   touch   href   安装   target   

原文地址:https://www.cnblogs.com/azureology/p/14819466.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!