English 中文(简体)
pydev on aptana3 unable to import gi.repository
原标题:

the following code should work

import gi
import gi.repository

this works in a python shell. And it also works if I save the file as a script then launch it in a terminal. but in aptana3 i get this:

import gi.repository
ImportError: No module named repository

i think this bug report may have a clue

  • Ubuntu Natty Gnome3 32Bit
  • Pydev on python 2.7.1+
  • System on python 2.7.1+
问题回答

Goto

window > preferences > PyDev > Interpreter - (Python/Jython/IronPython).

Goto Forced Builtins tab

Click on New

add gi

Apply and then check.





相关问题
Accessing samba shares with gio in python

I am trying to make a simple command line client for accessing shares via the Python bindings of gio (yes, the main requirement is to use gio). I can see that comparing with it s predecessor gnome-...

D. 注重全球无大型企业倒闭的窗口

我看上去了我需要把重点放在如此加速的钥匙(shortcuts)工作的德国技术合作公司/GDK光盘。 是否有任何人知道全球海洋研究公司是否甚至允许一个板块的窗户以主为主,如果是,......

Submenu items in Nautilus right-click menu

I am trying to write an extension for nautilus, which add an item to the menu that appears when you right-click a file (as shown in image) However, I would like to add a submenu to my custom menu ...

Add a changing icon to Ubuntu Panel

What would be the most simple way of adding and changing an icon in the Ubuntu (Gnome) Panel? I m looking for something as simple as shell scripting, but I m not restricted to that. Will write a ...

In Mono/Gnome, how can I look up the icon for a mime type?

Gnome.Icon and Gnome.ThumbnailFactory both want me to pass in a URI of a file whose icon I want -- I only have a MIME type, which I want to look up an icon for. Is there a GNOME C# API function which ...

热门标签