I recently build a Python package and installed it via Debian packager. It is installed on my system so I can use it in other projects. In my new project I have the same name of a package folder, namely, opal. I scanned the web including this site and everything pointed towards using:
from __future__ import absolute_import
Unfortunately, it couldn't resolve the problem, I suspect I am missing a detail.
I am using Python 2.7.3 and here are my project folder structures:
Installed package structure:
- opal
__init__.py
core.py
New Project structure:
- opal
- __init__.py
- net.py
In the new project I cannot do:
from opal.core import OpalClient
I always get an error that core
is not found under opal
!!!
If __future__
is the solution, can somebody provide me an example. I tried several ways and always got errors. I found this an awkward problem for such a neat language ;)
Cheers