我使用一个名为“Lucaschess”的国际象棋应用程序,它需要 PyQt4 模块才能工作。是否可以在 Ubuntu 20.04 上安装 Pyqt4?我知道 Ubuntu 不再支持这个包,但是有什么我可以解决的吗?
我正在使用一个名为 gnuradio-companion 的程序。如果我在没有 root 权限的情况下启动它,我将无法保存任何内容,因为我没有读/写权限。它给:
/usr/lib/python2.7/dist-packages/gnuradio/grc/gui/FileDialogs.py:102: GtkWarning: Failed to read filechooser settings from "/home/nick/.config/gtk-2.0/gtkfilechooser.ini": Permission denied
如果我开始
sudo gnuradio-companion
然后我在滥用 sudo,我也得到了
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
因为我丢失了运行时变量 XDG_RUNTIME_DIR。我可以用
sudo -E
保留环境变量,但后来我得到
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0
我猜是因为我只是在借用 root 权限。使用 sudo visudo 来修改运行时环境会产生同样的效果。
我应该如何配置读/写权限和运行时环境来解决这个问题?
我已经使用LDOCE5 Viewer几年了。它是使用朗文当代英语词典的绝佳软件(即查看器)。在 Ubuntu 14.04 和 16.04 上,我可以使用以下命令安装此软件:
sudo apt-get install pyqt4-dev-tools qt4-designer
sudo apt-get install python3-pyqt4.phonon-dbg
sudo apt-get install python-gst0.10-dbg
sudo apt-get install python-pip
sudo pip install --upgrade Whoosh
sudo apt-get install python-lxml
cd LDOCE5Viewer
sudo make build
sudo make install
我从GitHub 上的软件源存储库中启发了这些命令。现在使用 Ubuntu 18.04 我遇到了一些错误。我从这个链接意识到我应该安装另一个版本的 LDOCE5 查看器,它基于pyqt5
:
LDOCE5 的此查看器不再按预期工作。上游更新已经有一段时间了。不推荐安装此 PKGBUILD!考虑使用另一个版本的 LDOCE5 查看器( 强烈推荐https://github.com/purboo/ldoce5viewer-pyqt5)或完全不同的字典(例如:GoldenDict)
我找不到安装新 LDOCE5 查看器的任何说明。如何在 Ubuntu 上安装这个软件?
编辑:
这是根据答案的命令及其输出。
opt@pc:~$ cd ~/Downloads
opt@pc:~/Downloads$ sudo apt-get install git make python pyqt5-dev-tools python3-pyqt5 \
> python3-pyqt5.qtwebkit python3-lxml python3-whoosh qtgstreamer-plugins-qt5
[sudo] password for opt:
Reading package lists... Done
Building dependency tree
Reading state information... Done
make is already the newest version (4.1-9.1ubuntu1).
python is already the newest version (2.7.15~rc1-1).
python set to manually installed.
python3-lxml is already the newest version (4.2.1-1).
pyqt5-dev-tools is already the newest version (5.10.1+dfsg-1ubuntu2).
python3-pyqt5 is already the newest version (5.10.1+dfsg-1ubuntu2).
python3-pyqt5.qtwebkit is already the newest version (5.10.1+dfsg-1ubuntu2).
python3-whoosh is already the newest version (2.7.4+git6-g9134ad92-1).
qtgstreamer-plugins-qt5 is already the newest version (1.2.0-5).
git is already the newest version (1:2.17.1-1ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
opt@pc:~/Downloads$ git clone https://github.com/purboo/ldoce5viewer-pyqt5.git
Cloning into 'ldoce5viewer-pyqt5'...
remote: Counting objects: 625, done.
remote: Total 625 (delta 0), reused 0 (delta 0), pack-reused 625
Receiving objects: 100% (625/625), 1.22 MiB | 1.66 MiB/s, done.
Resolving deltas: 100% (216/216), done.
opt@pc:~/Downloads$ cd ldoce5viewer-pyqt5
opt@pc:~/Downloads/ldoce5viewer-pyqt5$ make
cd ldoce5viewer/qtgui/ui/; make
make[1]: Entering directory '/home/opt/Downloads/ldoce5viewer-pyqt5/ldoce5viewer/qtgui/ui'
pyuic5 advanced.ui -o advanced.py
pyuic5 indexer.ui -o indexer.py
pyuic5 main.ui -o main.py
make[1]: Leaving directory '/home/opt/Downloads/ldoce5viewer-pyqt5/ldoce5viewer/qtgui/ui'
cd ldoce5viewer/qtgui/resources/; make
make[1]: Entering directory '/home/opt/Downloads/ldoce5viewer-pyqt5/ldoce5viewer/qtgui/resources'
pyrcc5 resource.qrc -o __init__.py
make[1]: Leaving directory '/home/opt/Downloads/ldoce5viewer-pyqt5/ldoce5viewer/qtgui/resources'
python ./setup.py build
running build
running build_py
creating build
creating build/lib
creating build/lib/ldoce5viewer
copying ldoce5viewer/incremental.py -> build/lib/ldoce5viewer
copying ldoce5viewer/__init__.py -> build/lib/ldoce5viewer
copying ldoce5viewer/fulltext.py -> build/lib/ldoce5viewer
creating build/lib/ldoce5viewer/qtgui
copying ldoce5viewer/qtgui/async.py -> build/lib/ldoce5viewer/qtgui
copying ldoce5viewer/qtgui/advanced.py -> build/lib/ldoce5viewer/qtgui
copying ldoce5viewer/qtgui/indexer.py -> build/lib/ldoce5viewer/qtgui
copying ldoce5viewer/qtgui/__init__.py -> build/lib/ldoce5viewer/qtgui
copying ldoce5viewer/qtgui/access.py -> build/lib/ldoce5viewer/qtgui
copying ldoce5viewer/qtgui/main.py -> build/lib/ldoce5viewer/qtgui
copying ldoce5viewer/qtgui/config.py -> build/lib/ldoce5viewer/qtgui
creating build/lib/ldoce5viewer/qtgui/ui
copying ldoce5viewer/qtgui/ui/advanced.py -> build/lib/ldoce5viewer/qtgui/ui
copying ldoce5viewer/qtgui/ui/indexer.py -> build/lib/ldoce5viewer/qtgui/ui
copying ldoce5viewer/qtgui/ui/__init__.py -> build/lib/ldoce5viewer/qtgui/ui
copying ldoce5viewer/qtgui/ui/main.py -> build/lib/ldoce5viewer/qtgui/ui
copying ldoce5viewer/qtgui/ui/custom.py -> build/lib/ldoce5viewer/qtgui/ui
creating build/lib/ldoce5viewer/qtgui/resources
copying ldoce5viewer/qtgui/resources/__init__.py -> build/lib/ldoce5viewer/qtgui/resources
creating build/lib/ldoce5viewer/qtgui/utils
copying ldoce5viewer/qtgui/utils/soundplayer.py -> build/lib/ldoce5viewer/qtgui/utils
copying ldoce5viewer/qtgui/utils/singleapp.py -> build/lib/ldoce5viewer/qtgui/utils
copying ldoce5viewer/qtgui/utils/fontfallback.py -> build/lib/ldoce5viewer/qtgui/utils
copying ldoce5viewer/qtgui/utils/__init__.py -> build/lib/ldoce5viewer/qtgui/utils
copying ldoce5viewer/qtgui/utils/error.py -> build/lib/ldoce5viewer/qtgui/utils
creating build/lib/ldoce5viewer/qtgui/utils/mp3play
copying ldoce5viewer/qtgui/utils/mp3play/__init__.py -> build/lib/ldoce5viewer/qtgui/utils/mp3play
copying ldoce5viewer/qtgui/utils/mp3play/windows.py -> build/lib/ldoce5viewer/qtgui/utils/mp3play
creating build/lib/ldoce5viewer/utils
copying ldoce5viewer/utils/cdb.py -> build/lib/ldoce5viewer/utils
copying ldoce5viewer/utils/__init__.py -> build/lib/ldoce5viewer/utils
copying ldoce5viewer/utils/compat.py -> build/lib/ldoce5viewer/utils
copying ldoce5viewer/utils/text.py -> build/lib/ldoce5viewer/utils
creating build/lib/ldoce5viewer/ldoce5
copying ldoce5viewer/ldoce5/filemap.py -> build/lib/ldoce5viewer/ldoce5
copying ldoce5viewer/ldoce5/transform_body.py -> build/lib/ldoce5viewer/ldoce5
copying ldoce5viewer/ldoce5/transform.py -> build/lib/ldoce5viewer/ldoce5
copying ldoce5viewer/ldoce5/__init__.py -> build/lib/ldoce5viewer/ldoce5
copying ldoce5viewer/ldoce5/utils.py -> build/lib/ldoce5viewer/ldoce5
copying ldoce5viewer/ldoce5/advtree.py -> build/lib/ldoce5viewer/ldoce5
copying ldoce5viewer/ldoce5/idmreader.py -> build/lib/ldoce5viewer/ldoce5
copying ldoce5viewer/ldoce5/extract.py -> build/lib/ldoce5viewer/ldoce5
creating build/lib/ldoce5viewer/static
creating build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/body.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/word_sets.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/activator.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/search.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/etymologies.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/thesaurus.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/phrases.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/word_families.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/jquery.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/common.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/examples.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/collocations.js -> build/lib/ldoce5viewer/static/scripts
copying ldoce5viewer/static/scripts/entry.js -> build/lib/ldoce5viewer/static/scripts
creating build/lib/ldoce5viewer/static/scripts/colorbox
copying ldoce5viewer/static/scripts/colorbox/jquery.colorbox.js -> build/lib/ldoce5viewer/static/scripts/colorbox
copying ldoce5viewer/static/scripts/colorbox/colorbox.css -> build/lib/ldoce5viewer/static/scripts/colorbox
creating build/lib/ldoce5viewer/static/scripts/colorbox/images
copying ldoce5viewer/static/scripts/colorbox/images/loading.gif -> build/lib/ldoce5viewer/static/scripts/colorbox/images
copying ldoce5viewer/static/scripts/colorbox/images/close.png -> build/lib/ldoce5viewer/static/scripts/colorbox/images
creating build/lib/ldoce5viewer/static/documents
copying ldoce5viewer/static/documents/about.html -> build/lib/ldoce5viewer/static/documents
creating build/lib/ldoce5viewer/static/images
copying ldoce5viewer/static/images/speaker_br.png -> build/lib/ldoce5viewer/static/images
copying ldoce5viewer/static/images/speaker_am.png -> build/lib/ldoce5viewer/static/images
copying ldoce5viewer/static/images/external-link.png -> build/lib/ldoce5viewer/static/images
copying ldoce5viewer/static/images/sp.png -> build/lib/ldoce5viewer/static/images
copying ldoce5viewer/static/images/speaker_eg.png -> build/lib/ldoce5viewer/static/images
copying ldoce5viewer/static/images/external-hover.png -> build/lib/ldoce5viewer/static/images
copying ldoce5viewer/static/images/external.png -> build/lib/ldoce5viewer/static/images
creating build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/about.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/common.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/collocations.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/search.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/word_families.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/colorbox.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/body.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/entry.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/list.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/activator.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/word_sets.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/phrases.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/thesaurus.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/etymologies.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/static/styles/examples.css -> build/lib/ldoce5viewer/static/styles
copying ldoce5viewer/qtgui/resources/resource.qrc -> build/lib/ldoce5viewer/qtgui/resources
copying ldoce5viewer/qtgui/resources/next-mac.png -> build/lib/ldoce5viewer/qtgui/resources
copying ldoce5viewer/qtgui/resources/Makefile -> build/lib/ldoce5viewer/qtgui/resources
copying ldoce5viewer/qtgui/resources/ldoce5viewer.svg -> build/lib/ldoce5viewer/qtgui/resources
copying ldoce5viewer/qtgui/resources/prev-mac.png -> build/lib/ldoce5viewer/qtgui/resources
copying ldoce5viewer/qtgui/resources/ldoce5viewer.ico -> build/lib/ldoce5viewer/qtgui/resources
copying ldoce5viewer/qtgui/resources/ldoce5viewer.png -> build/lib/ldoce5viewer/qtgui/resources
copying ldoce5viewer/qtgui/resources/ldoce5viewer.icns -> build/lib/ldoce5viewer/qtgui/resources
creating build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-properties.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-out-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/application-exit.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/application-exit-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/help-about-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-find-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-out.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-in-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/help-about-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-print-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-original-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-clear-48-src.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-clear-48.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-down.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/iconblock-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-find-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-print-preview-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-up.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/reload.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-down-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-print-preview-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/Makefile -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/window-close-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/reload-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-clear-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/LICENSE.txt -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-clear.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-previous.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/application-exit-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/window-close-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/window-close-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-clear-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/reload-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-out-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/star.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/iconblock-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-next-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-in.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/iconblock-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/icongen.py -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-in-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-up-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-find-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/star-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/window-close.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/help-contents-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-next-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-print.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-properties-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-next-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-properties-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-print-preview.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-previous-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-print-preview-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/star-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-in-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-copy-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-previous-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/help-about.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-previous-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-next.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/reload-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-find.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/star-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/help-contents-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-print-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-print-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-up-22.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/application-exit-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-copy-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/iconblock.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/document-properties-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-copy.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-down-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-original.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-original-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-out-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/help-about-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-down-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/zoom-original-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/help-contents.svg -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/go-up-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-copy-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/edit-clear-16.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/resources/icons/help-contents-24.png -> build/lib/ldoce5viewer/qtgui/resources/icons
copying ldoce5viewer/qtgui/ui/advanced.ui -> build/lib/ldoce5viewer/qtgui/ui
copying ldoce5viewer/qtgui/ui/indexer.ui -> build/lib/ldoce5viewer/qtgui/ui
copying ldoce5viewer/qtgui/ui/Makefile -> build/lib/ldoce5viewer/qtgui/ui
copying ldoce5viewer/qtgui/ui/main.ui -> build/lib/ldoce5viewer/qtgui/ui
running build_scripts
creating build/scripts-3.6
copying and adjusting scripts/ldoce5viewer -> build/scripts-3.6
changing mode of build/scripts-3.6/ldoce5viewer from 644 to 755
opt@pc:~/Downloads/ldoce5viewer-pyqt5$ python3 ./ldoce5viewer.py
need to run '$ make' in order for the program to work
opt@pc:~/Downloads/ldoce5viewer-pyqt5$
我在 Ubuntu 14 上使用 python 和 PyQt4 编写了一个小型 GUI。当我尝试在 Ubuntu 18.04 上运行相同的脚本时,我收到一个导入错误:
ModuleNotFoundError: No module named 'PyQt4'
我已经使用 apt-get 安装了以下软件包:
sudo apt-get install python-qt4
sudo apt-get install libqt4-dev
sudo apt-get install pyqt4-dev-tools
sudo apt-get install pyqt4.qsci-dev
简短:应该使 PyQt4 在机器上运行的所有包。我没有找到任何有同样问题的人,也没有发现 PyQt4 不能在 Ubuntu 18 上运行的网站。
难道没有可能在 Ubuntu 18 上运行 PyQt4 吗?还是我应该服用 PyQt5?
对不起,如果这是错误的论坛,如果你不能回答这个问题,我会在堆栈交换上发布它。
我的 Python 版本是 3.6.5
我正在从源代码安装 ROS 并收到有关 PyQt5 的错误。
[ 88%] Running SIP generator for qt_gui_cpp_sip Python bindings...
sip: Deprecation warning: qt_gui_cpp.sip:1: %Module version number should be specified using the 'version' argument
sip: Unable to find file "QtCore/QtCoremod.sip"
Traceback (most recent call last):
File "/home/zyh/ros_catkin_ws/install_isolated/share/python_qt_binding/cmake/sip_configure.py", line 80, in <module>
subprocess.check_call(cmd)
File "/usr/lib/python2.7/subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/sip', '-c', '/home/zyh/ros_catkin_ws/build_isolated/qt_gui_cpp/sip/qt_gui_cpp_sip', '-b', '/home/zyh/ros_catkin_ws/build_isolated/qt_gui_cpp/sip/qt_gui_cpp_sip/pyqtscripting.sbf', '-I', '/usr/share/sip/PyQt5', '-w', '-x', 'VendorID', '-t', 'WS_X11', '-t', 'Qt_5_9_1', '-x', 'Py_v3', 'qt_gui_cpp.sip']' returned non-zero exit status 1
src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/build.make:89: recipe for target 'sip/qt_gui_cpp_sip/Makefile' failed
make[2]: *** [sip/qt_gui_cpp_sip/Makefile] Error 1
如我们所见,错误来自subprocess.CalledProcessError: ...
.
我发现 '/usr/share/sip/PyQt5' 不存在。
我已阅读如何在 Ubuntu 14.10 中为 Python 3 安装 PyQt?但这无济于事。我可以pip install pyqt4
而且我可以PyQt4
在/usr/share/sip/
.
好像是ROS在找PyQt5
,/usr/share/sip/
怎么安装PyQt5
?