安装xdg-open

在centos6.8中运行一个python程序时,出现如下错误:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
......省略n行
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'xdg-open'

 

紫色部分是问题的根源

我在命令行中做了如下操作:

[root@pc deployment]# which xdg-open
/usr/bin/which: no xdg-open in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/soft/jdk1.8.0_111/bin:/root/bin:/sbin:/usr/bin:/usr/sbin)

于是猜测是我的centos中没有安装xdg-open

[root@pc deployment]# yum list | grep xdg-open
[root@pc deployment]#

但在yum源中找不到xdg-open,在网上查了很多关于xdg-open的资料,大多是在讲如何使用xdg-open,没有讲如何安装.

最终在一篇英文资料中看到了.原来要安装xdg-utils

 

[root@pc deployment]# yum install xdg-utils

之后xdg-open命令就可以使用了.

 

posted @ 2017-04-26 16:39  pikaqiu^_^  阅读(10076)  评论(0编辑  收藏  举报