خرید بک لینک

Vote count: 0

I have following structure:

repo(master)/
    projectname/
        __init__.py
        __main__.py
        core/
            __init__.py
            system.py
            foo.py
        unit/
            __init__.py
            cookie.py
            other-foo.py

And I run the project from /path/to/repo(master) by $ python projectname --unit=cookie

The __main__ would run. It has:

from core import system 
system.init()

Here's what system.py has:

from ..unit import cookie
cookie.run()

But I get this error: system.py: ValueError: Attempted relative import beyond toplevel package

What am I doing wrong here?

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 20 ارديبهشت 1395 ساعت: 11:44

صفحه بندی