我用过LDOCE5 查看器已经有几年了。它是使用朗文当代英语词典的一款很棒的软件(即查看器)。在 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 Viewer 的另一个版本其依据是pyqt5
:
LDOCE5 查看器不再按预期工作。上游已经有一段时间没有更新了。不建议安装此 PKGBUILD!请考虑使用其他版本的 LDOCE5 查看器( https://github.com/purboo/ldoce5viewer-pyqt5强烈推荐)或完全不同的词典(例如:GoldenDict)
我找不到任何有关安装新 LDOCE5 Viewer 的说明。如何在 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$
答案1
基于 Qt4 的版本
我已经做了一些测试,现在我已经有了关于安装基于 Qt4 的 LDOCE5 Viewer 版本的完整工作解决方案。
我们需要安装多种软件包 - 大多数来自官方 18.04 LTS 存储库,6 个来自 16.04 LTS 存储库。通常不推荐这种方法,但我们希望让软件再次运行而不会造成功能损失。
首先,我们从官方 18.04 LTS 存储库安装软件包:
sudo apt-get install git make pyqt4-dev-tools python-lxml \
python-whoosh libqt4-opengl python-gst-1.0 \
libcanberra-gtk3-module libcanberra-gtk-module
然后我们从 16.04 LTS 存储库下载软件包、安装它们并固定(锁定)它们的版本:
cd ~/Downloads
wget http://mirrors.kernel.org/ubuntu/pool/universe/p/python-qt4/pyqt4-dev-tools_4.11.4+dfsg-1build4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/p/python-qt4/python-qt4_4.11.4+dfsg-1build4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/s/sip4/python-sip_4.17+dfsg-1build1_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/q/qtwebkit-source/libqtwebkit4_2.3.2-0ubuntu11_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/p/python-qt4/python-qt4-phonon_4.11.4+dfsg-1build4_amd64.deb
sudo apt-get install ./*.deb
cat <<EOF | sudo tee /etc/apt/preferences.d/pin-ldoce5
Package: pyqt4-dev-tools
Pin: version 4.11.4+dfsg-1build4
Pin-Priority: 1337
Package: python-qt4
Pin: version 4.11.4+dfsg-1build4
Pin-Priority: 1337
Package: python-sip
Pin: version 4.17+dfsg-1build1
Pin-Priority: 1337
Package: libqtwebkit4
Pin: version 2.3.2-0ubuntu11
Pin-Priority: 1337
Package: libpng12
Pin: version 0_1.2.54-1ubuntu1.1
Pin-Priority: 1337
Package: python-qt4-phonon
Pin: version 4.11.4+dfsg-1build4
Pin-Priority: 1337
EOF
最后我们克隆 git-repository,制作并安装 LDOCE5 Viewer 到系统:
git clone https://github.com/ciscorn/ldoce5viewer.git
cd ldoce5viewer
make
sudo make install
结果我们将得到LDOCE5 查看器启动器中的图标。
它将具有完整功能,包括声音(发音按钮表示一个单词或一个句子)。
基于 Qt5 的版本
由于我们无法在 Ubuntu 18.04 LTS 上轻松安装基于 Qt4 的版本,因此让我们尝试基于 Qt5 的版本。
安装
首先我们需要安装一些依赖项:
sudo apt-get install git make python pyqt5-dev-tools python3-pyqt5 \
python3-pyqt5.qtwebkit python3-lxml python3-whoosh qtgstreamer-plugins-qt5
然后下载并安装软件
cd ~/Downloads
git clone https://github.com/purboo/ldoce5viewer-pyqt5.git
cd ldoce5viewer-pyqt5
make
并尝试运行python3 ./ldoce5viewer.py
。
我没有ldoce5.data
文件,因此在 LDOCE5 查看器窗口中只看到此消息:
我不确定它是否功能齐全。请自己尝试一下。
调试
在聊天过程中我们发现,python2 和 python3 由 Anaconda 发行版提供。
$ which python3
/home/opt/anaconda3/bin/python3
$ which python
/home/opt/anaconda3/bin/python
$ echo $PATH
/home/opt/anaconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
但我们需要使用系统范围的版本。因此我们可以编辑~/.bashrc
或~/.profile
删除/home/opt/anaconda3/bin
它,或者在一个会话中运行:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
然后运行该软件。
索引已完成,字典功能齐全。
已知的问题
当用户点击单词或句子的发音按钮时,会出现一个标题为“错误控制台' 出现,其内容为:
发生未处理的错误。
很抱歉给您带来不便。
请将以下文本复制到错误报告中:回溯(最近一次调用最后一次):文件“/home/opt/Downloads/ldoce5viewer-pyqt5/ldoce5viewer/qtgui/utils/soundplayer.py”,第 114 行,需要数据 appsrc.emit('push-buffer',Gst.Buffer.new_wrapped(self._data [:size]))UnicodeDecodeError:'ascii'编解码器无法解码位置 0 中的字节 0xff:序数不在范围内(128)
链接
也可以看看:
答案2
关于之前基于QT5的安装控制台报错:
发生未处理的错误。
很抱歉给您带来不便。
请将以下文本复制到错误报告中:回溯(最近一次调用最后一次):文件“/home/opt/Downloads/ldoce5viewer-pyqt5/ldoce5viewer/qtgui/utils/soundplayer.py”,第 114 行,需要数据 appsrc.emit('push-buffer',Gst.Buffer.new_wrapped(self._data [:size]))UnicodeDecodeError:'ascii'编解码器无法解码位置 0 中的字节 0xff:序数不在范围内(128)
我转到 ldoce5viewer/qtgui/utils/soundplayer.py 文件的第 114 行并进行了更改
appsrc.emit('push-buffer', Gst.Buffer.new_wrapped(self._data[:size]))
经过
appsrc.emit('push-buffer', Gst.Buffer.new_wrapped(self._data[:size].data()))
经过这种改变,声音对我来说就好了。
答案3
Ubuntu 18.04 Python 3.7.3
apt 安装 libqtwebkit-dev
tar zxvf PyQt-x11-gpl-4.10.tar.gz
cd PyQt-x11-gpl-4.10
六、配置
396 check_module("phonon", "phonon/videowidget.h",
397 "new Phonon::VideoWidget()")
398
399 pyqt_modules.append("phonon"); --->> add
400
401 check_module("QtAssistant", "qassistantclient.h",
402 "new QAssistantClient(\"foo\")", extra_lib_dirs=ass_lib_dirs,
403 extra_libs=ass_libs)
更改 QtCore/QtGui/QtScript 的 Makefile 如下:
CXXFLAGS = -m64 -pipe -fPIC -O2 -Wall -W -D_REENTRANT -std=c++0x -Wno-narrowing
python 配置.py
制作
进行安装