红联Linux门户
Linux帮助

ubuntu14.04有道辞典安装成功后打不开的解决办法

发布时间:2015-11-15 09:44:52来源:linux网站作者:风中之哨

1.安装有道辞典

在以下官方网站下载deb包进行安装

http://cidian.youdao.com/multi.html#linuxAll


2.安装成功后在laucher中点击,发现无法打开


3.尝试在命令行打开,出现以下错误信息,并google之

yasin@DTT:/usr/share/youdao-dict$
yasin@DTT:/usr/share/youdao-dict$ youdao-dict
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 25, in <module>ewmh = EWMH()
File "/usr/share/youdao-dict/dae/ewmh.py", line 50, in __init__
self.display = _display or display.Display()
File "/usr/lib/python3/dist-packages/Xlib/display.py", line 80, in __init__
self.display = _BaseDisplay(display)
File "/usr/lib/python3/dist-packages/Xlib/display.py", line 62, in __init__
display.Display.__init__(*(self, ) + args, **keys)
File "/usr/lib/python3/dist-packages/Xlib/protocol/display.py", line 129, in __init__
raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'No protocol specified\n'
yasin@DTT:/usr/share/youdao-dict$
yasin@DTT:/usr/share/youdao-dict$


4.参考以下链接,了解到上述错误原因和临时解决方案

http://stackoverflow.com/questions/31902846/how-to-fix-error-xlib-error-displayconnectionerror-cant-connect-to-display-0

https://github.com/LiuLang/python3-xlib/issues/6

https://github.com/LiuLang/kwplayer

https://wiki.archlinux.org/index.php/Xhost

https://en.wikipedia.org/wiki/X_Window_authorization


5.按照以上方案尝试,有道辞典可正常打开,log如下
yasin@DTT:/usr/share/youdao-dict$
yasin@DTT:/usr/share/youdao-dict$ xhost +
access control disabled, clients can connect from any host
yasin@DTT:/usr/share/youdao-dict$
yasin@DTT:/usr/share/youdao-dict$
yasin@DTT:/usr/share/youdao-dict$ youdao-dict
<class 'Xlib.protocol.request.QueryExtension'>
Youdao Dict Unique Service is started...
ATTENTION: default value of option bo_reuse overridden by environment.


6.关闭有道辞典后执行以下命令,重新开启host-based access

yasin@DTT:/usr/share/youdao-dict$ xhost -
access control enabled, only authorized clients can connect


fedora 22安装有道词典:http://www.linuxdiyf.com/linux/12534.html

在Fedora21上安装有道词典youdao-dict on Fedora21:http://www.linuxdiyf.com/linux/11912.html

在Ubuntu 15.04/14.10/14.04下安装有道词典:http://www.linuxdiyf.com/linux/11440.html

有道词典Linux版有5大亮点:http://www.linuxdiyf.com/linux/11563.html