Tyl*_*sky 4 pygtk python3 14.04
我试图为 pushbullet 运行一个指标,但无济于事。当我注意到 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 >
Run Code Online (Sandbox Code Playgroud)
尝试手动导入。
~ > 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'
>>>
Run Code Online (Sandbox Code Playgroud)
但出于某种原因,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
>>>
Run Code Online (Sandbox Code Playgroud)
我安装了 Anaconda。我正在尝试在系统安装的 python3 上导入 gi。我希望这是正确的术语。安装了python3-gi。
更奇怪的是我可以运行indicator-cpufreq
大家有什么想法或建议吗?谢谢你的帮助!
安装在系统范围内的 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
>>>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10280 次 |
| 最近记录: |