安装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命令就可以使用了.

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM