「Linux」- 翻译工具

  CREATED BY JENKINSBOT

翻译工具

一帆文档翻译 | PDF翻译,就用一帆
https://fanyipdf.com/

有道词典(for Linux)

Linux版 – 有道词典

# 05/04/2022 该部分内容记录于很久之前(或许是 2018 年之前),已近乎失效。当时是 youdao-dict v1.1 版本,现在已更新到 youdao-dict v6.0 版本。鉴于我们不再使用有道词典,所以此部分内容未再更新。

### Debian

# 安装依赖
apt-get install python3-pyqt5 python3-pyqt5.qtwebkit python3-xlib \
    python3-lxml python3-pyqt5.qtquick

# 下载有道词典 Linux 版
# http://cidian.youdao.com/index-linux.html
# 我们下载的是tar.gz的压缩包,没有下载deb包。
wget ...

# 解压 tar.gz 文件:
mkdir youdao-dic && tar -xf youdao-dict_1.1.0-0~amd64.tar.gz -C youdao-dic

#进入目录 youdao-dic 并执行 install.sh 脚本:
cd youdao-dic && chmod u+x install.sh && ./install.sh

# 启动有道字典
youdao-dict

No module named ‘PyQt5’

Traceback (most recent call last):
  File "/usr/bin/youdao-dict", line 27, in <module>
	from dae.daeclient import DAEClient
  File "/usr/share/youdao-dict/dae/daeclient.py", line 31, in <module>
	from PyQt5.Qt import QApplication
ModuleNotFoundError: No module named 'PyQt5'

原因:缺少PYQt5模块。
解决:apt-get install python3-pyqt5

No module named ‘PyQt5.QtWebKitWidgets’

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

原因:缺少PyQt5.QtWebKitWidgets模块。
解决:apt-get install python3-pyqt5.qtwebkit

No module named ‘Xlib’

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

原因:缺少Xlib模块。
解决:apt-get install python3-xlib

cannot import name ‘QtQuick’

Load "youdao" plugin error: cannot import name 'QtQuick'
Traceback (most recent call last):
  File "/usr/share/youdao-dict/dae/plugins.py", line 81, in load
	assets.pluginobjects += self.get_plugin_object(plugin_name)
  File "/usr/share/youdao-dict/dae/plugins.py", line 70, in get_plugin_object
	plugin = self.load_plugin(plugin_name)
  File "/usr/share/youdao-dict/dae/plugins.py", line 53, in load_plugin
	plugin = imp.load_source(plugin_name, os.path.join(path, 'init.py'))
  File "/usr/lib/python3.6/imp.py", line 172, in load_source
	module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/share/youdao-dict/app/plugins/youdao/init.py", line 35, in <module>
	from window import SplashWindow
  File "/usr/share/youdao-dict/app/plugins/youdao/window.py", line 26, in <module>
	from PyQt5 import QtCore, QtQuick, QtWidgets, QtGui
ImportError: cannot import name 'QtQuick'
ATTENTION: default value of option bo_reuse overridden by environment.
Traceback (most recent call last):
  File "/usr/bin/youdao-dict", line 35, in <module>
	DAEClient(app_dir)
  File "/usr/share/youdao-dict/dae/daeclient.py", line 81, in init
	self.window = Window(None, index_path)
  File "/usr/share/youdao-dict/dae/window.py", line 53, in init
	super(Window, self).init(parent if isDialog else None)
  File "/usr/share/youdao-dict/dae/shadowwindow.py", line 41, in init
	self.setShadowWidth(10)
  File "/usr/share/youdao-dict/dae/shadowwindow.py", line 60, in setShadowWidth
	xutils.show_shadow(xutils.get_xwindow(int(self.winId())), str(width))
  File "/usr/share/youdao-dict/dae/xutils.py", line 32, in show_shadow
	ewmh.setXWindowProperty(xwin, "DEEPIN_WINDOW_SHADOW", str(shadow_width))
  File "/usr/share/youdao-dict/dae/ewmh.py", line 119, in setXWindowProperty
	property_content,
  File "/usr/lib/python3/dist-packages/Xlib/xobject/drawable.py", line 436, in change_property
	data = (format, data))
  File "/usr/lib/python3/dist-packages/Xlib/protocol/rq.py", line 1347, in init
	self._binary = self._request.to_binary(*args, **keys)
  File "/usr/lib/python3/dist-packages/Xlib/protocol/rq.py", line 1021, in to_binary
	v, l, fm = f.pack_value(field_args[f.name])
  File "/usr/lib/python3/dist-packages/Xlib/protocol/rq.py", line 696, in pack_value
	a = array(array_unsigned_codes[size], val)
TypeError: cannot use a str to initialize an array with typecode 'B'

原因:缺少QtQuick模块。
解决:apt-get install python3-pyqt5.qtquick