Python3无法导入gi

泰勒·别列佐夫斯基(Tyler Berezowsky)

我正在尝试为手推车运行指标,但无济于事。当我发现python3无法导入gi时,我尝试通过终端运行

bin > python3 pushbullet-indicator
Traceback (most recent call last):
 File "pushbullet-indicator", line 26, in <module>
 import gi
 ImportError: No module named 'gi'
bin > 

尝试手动导入。

~ > python3
Python 3.4.1 (default, Sep 27 2014, 09:00:29) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'gi'
>>> 

但是由于某种原因,Python2可以吗?

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> 

我安装了Anaconda。我正在尝试在系统安装的python3上导入gi。我希望这是正确的术语。python3-gi已安装。

甚至更陌生的是我可以运行indicator-cpufreq

你们有什么想法或建议吗?谢谢你的帮助!

西尔文·皮诺(Sylvain Pineau)

系统范围内安装的python软件包可能不适用于anaconda目录中安装的python版本。

而是尝试使用系统解释器的完整路径来加载脚本:

$ /usr/bin/python3
Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> 

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章