Ubuntu16.04安装有道词典问题总结与解决


折腾了半天总算解决了问题,包括有道词典安装、依赖问题以及取词划词崩溃问题。网上资源比较多也比较杂。在此作个搬运工,记录一下。

安装教程

参考:https://blog.csdn.net/xiang_shao344/article/details/82984253

根据官网提示,先更新吧。需要几分钟时间。(根据自己电脑升级内容时间不等,我就好久。。。 而且个人感觉16.04不升级软件应该问题不大,请自测)

sudo apt-get update;sudo apt-get dist-upgrade

一、安装下列依赖包:直接复制运行,如果报错,

运行:sudo apt-get -f install,然后再运行下面命令的安装过程

sudo apt-get install python3-pyqt5 -y;sudo apt-get install python3-xlib -y;sudo apt-get install tesseract-ocr -y;sudo apt-get install tesseract-ocr-eng -y;sudo apt-get install tesseract-ocr-chi-sim -y;sudo apt-get install tesseract-ocr-chi-tra -y;sudo apt-get install ttf-wqy-microhei -y;sudo apt-get install python3-pyqt5.qtmultimedia -y;sudo apt-get install python3-pyqt5.qtquick -y;sudo apt-get install python3-pyqt5.qtwebkit -y;sudo apt-get install qtdeclarative5-controls-plugin -y;sudo apt-get install libqt5multimedia5-plugins -y

二、官网下载deb包,选择Ubuntu版

Ubuntu-64位 有道词典 下载地址

三、下载完后对安装包的控制文件编辑

删除依赖关系中的gstreamer0.10-plugins-ugly,因为新版Ubuntu已经没有了,官网说明可以删除不影响功能,可能官网人员懒得为linux版的软件修改了(上一次发布是15年了)。

  1. 解压deb包:
    dpkg -X ./youdao-dict_1.1.0-0-ubuntu_amd64.deb youdao
  2. 解压deb包中的control信息(包的依赖就写在这个文件里面):
    dpkg -e ./youdao-dict_1.1.0-0-ubuntu_amd64.deb youdao/DEBIAN
    进入youdao/DEBIAN目录下,编辑control文件,删除Depends里面的gstreamer0.10-plugins-ugly(包括该项前面的逗号,)
    重新打包:
  3. dpkg-deb -b youdao youdao.deb
  4. 开始安装该软件包:
    sudo dpkg -i youdao.deb

四、输入youdao-dict即可运行有道词典

youdao-dict

问题解决

安装完了运行之后依旧会有各种依赖问题,参考:https://blog.csdn.net/u012075442/article/details/52614452
我就直接粘贴大佬总结的问题了

  1. 错误:

moon@moon-emachines-D525 ~/Downloads $ youdao-dict
Youdao Dict Unique Service is started…
ATTENTION: default value of option bo_reuse overridden by environment.
file:///usr/share/youdao-dict/app/plugins/youdao/qml/StrokeResultWindow.qml:26:1: module “QtGraphicalEffects” is not installed
import QtGraphicalEffects 1.0
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/MiniWindow.qml:25:1: module “QtGraphicalEffects” is not installed
import QtGraphicalEffects 1.0
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/Splash.qml:25:1: module “QtGraphicalEffects” is not installed
import QtGraphicalEffects 1.0
^

解决办法:

sudo apt-get install libqt5qml-graphicaleffects
  1. 错误:

Traceback (most recent call last):
File “/usr/bin/youdao-dict”, line 27, in
from dae.daeclient import DAEClient
File “/usr/share/youdao-dict/dae/daeclient.py”, line 36, in
from dae.window import Window
File “/usr/share/youdao-dict/dae/window.py”, line 29, in
from dae.webview import WebView
File “/usr/share/youdao-dict/dae/webview.py”, line 27, in
from dae.webpage import WebPage
File “/usr/share/youdao-dict/dae/webpage.py”, line 27, in
from PyQt5.QtWebKitWidgets import QWebPage, QWebInspector
ImportError: No module named ‘PyQt5.QtWebKitWidgets’

解决办法:

sudo apt-get install python3-pyqt*
  1. 错误:

Traceback (most recent call last):
File “/usr/bin/youdao-dict”, line 27, in
from dae.daeclient import DAEClient
File “/usr/share/youdao-dict/dae/daeclient.py”, line 36, in
from dae.window import Window
File “/usr/share/youdao-dict/dae/window.py”, line 30, in
from dae.shadowwindow import ShadowWindow
File “/usr/share/youdao-dict/dae/shadowwindow.py”, line 28, in
import dae.xutils as xutils
File “/usr/share/youdao-dict/dae/xutils.py”, line 23, in
import Xlib.X
ImportError: No module named ‘Xlib’

解决办法:

sudo apt-get install python3-xlib
  1. 错误:

file:///usr/share/youdao-dict/app/plugins/youdao/qml/StrokeResultWindow.qml:28:1: module “QtQuick.Controls.Styles” is not installed
import QtQuick.Controls.Styles 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/StrokeResultWindow.qml:27:1: module “QtQuick.Controls” is not installed
import QtQuick.Controls 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/StrokeResultWindow.qml:25:1: module “QtQuick.Window” is not installed
import QtQuick.Window 2.0
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/StrokeResultWindow.qml:28:1: module “QtQuick.Controls.Styles” is not installed
import QtQuick.Controls.Styles 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/StrokeResultWindow.qml:27:1: module “QtQuick.Controls” is not installed
import QtQuick.Controls 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/StrokeResultWindow.qml:25:1: module “QtQuick.Window” is not installed
import QtQuick.Window 2.0
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/StrokeResultWindow.qml:28:1: module “QtQuick.Controls.Styles” is not installed
import QtQuick.Controls.Styles 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/StrokeResultWindow.qml:27:1: module “QtQuick.Controls” is not installed
import QtQuick.Controls 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/StrokeResultWindow.qml:25:1: module “QtQuick.Window” is not installed
import QtQuick.Window 2.0
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/MiniWindowMenu.qml:42:9: Type MenuItem unavailable
MenuItem {
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/MenuItem.qml:25:1: module “QtQuick.Controls” is not installed
import QtQuick.Controls 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/MiniWindow.qml:27:1: module “QtQuick.Controls.Styles” is not installed
import QtQuick.Controls.Styles 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/MiniWindow.qml:26:1: module “QtQuick.Controls” is not installed
import QtQuick.Controls 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/MiniWindow.qml:27:1: module “QtQuick.Controls.Styles” is not installed
import QtQuick.Controls.Styles 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/MiniWindow.qml:26:1: module “QtQuick.Controls” is not installed
import QtQuick.Controls 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/TrayIconMenu.qml:42:9: Type MenuItem unavailable
MenuItem {
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/MenuItem.qml:25:1: module “QtQuick.Controls” is not installed
import QtQuick.Controls 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/Splash.qml:27:1: module “QtQuick.Controls.Styles” is not installed
import QtQuick.Controls.Styles 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/Splash.qml:26:1: module “QtQuick.Controls” is not installed
import QtQuick.Controls 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/Splash.qml:27:1: module “QtQuick.Controls.Styles” is not installed
import QtQuick.Controls.Styles 1.1
^
file:///usr/share/youdao-dict/app/plugins/youdao/qml/Splash.qml:26:1: module “QtQuick.Controls” is not installed
import QtQuick.Controls 1.1
^
Traceback (most recent call last):
File “/usr/share/youdao-dict/app/plugins/youdao/window.py”, line 161, in updateStrokeIconPosition
self.rootObject().updateStrokeIconPosition(x, y)

解决办法:

sudo apt-get install qtdeclarative5-controls-plugin

关键问题(取词划词无效崩溃)

依赖都解决了,发现屏幕取词划词无法使用,而且一取词就崩溃了。终于也找到了大佬的解决方法。
参考:https://blog.csdn.net/linmingan/article/details/83376490安装有道词典这才是最关键的功能,下面继续粘贴大佬内容

安装完有道后,发现不能划词\取词。在shell终端驱动youdao-dict后进行屏幕取词翻译,显示如下错误:

QOpenGLShaderProgram::uniformLocation( qt_Matrix ): shader program is not linked

经过调查发现是有道词典找不到显卡驱动问题。
在/etc/ld.so.conf.d中的x86_64-linux-gnu_GL.conf中可以发现有显卡驱动安装目录,通过下面的命令可以查看:

cd /etc/ld.so.conf.d
cat x86_64-linux-gnu_GL.conf

显示如下内容:

/usr/lib/nvidia-340 (笔者注:不同显卡版本数字不一样) 
/usr/lib32/nvidia-340

查看i386-linux-gnu_GL.conf,发现是空的。只要将x86_64-linux-gnu_GL.conf的内容复制到i386-linux-gnu_GL.conf就可以。具体如下:

sudo cp x86_64-linux-gnu_GL.conf  i386-linux-gnu_GL.conf
sudo ldconfig

重启有道词典就可以使用取词功能了。

总结

联网查询取词划词翻译的工具也就有道比较好用了,不过安装体验确实很难受,各种问题终于都解决完了。

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值