Running a project with absolute imports

Until now I never had any issue with pycharm, but recently I discovered photini (a open source photo metadata editor) written in python and I wanted to collaborate (project here, that builds normally out of pycharm but fails inside.

The folder structure is the following (only problematic files here):


To run the project I should be able to just run and start, but it doesn't work.

The most problematic bits are:

from import gi_version

And also in

import pgi
using_pgi = True
except ImportError:
using_pgi = False
import gi

The issue seems to be that there's a library called gi already on the system, and according to photini's author the problem i because of the way pycharm is importing this libraries, quoting:

The Photini module imports the PyGObject module gi. If you
allow "relative" imports, then Python might try to find
gi.require_version in instead of gi. Absolute imports are the
default when running Python normally so this isn't a problem. Does
running in an IDE allow relative imports? Is this an option that can be
turned off?

So far the only thing I could check was to change src as 'Sources Root', but it doesn't make a difference, and I'm quite lost.

Could anyone spot the issue here? Any help appreciated

Please sign in to leave a comment.