how to fix: "relative cimport beyond main package is not allowed"

655 views
Skip to first unread message

Michael Haberler

unread,
Jan 3, 2015, 1:48:05 PM1/3/15
to cython...@googlegroups.com
we're using cython 0.19 just fine with these files: https://github.com/machinekit/machinekit/tree/master/src/hal/cython/machinekit


Error compiling Cython file:
------------------------------------------------------------
...
# made usable: Michael Haberler 6/2014

cimport cython
cimport hal_const
cimport ring_const
from .hal cimport *
^
------------------------------------------------------------

hal/cython/machinekit/hal.pyx:12:0: relative cimport beyond main package is not allowed


I would appreciate a hint how to resolve this - I could not find any docs/google result and the commit leaves me completely in the dark as to what is required

thanks in advance!

- Michael

Michael Haberler

unread,
Jan 5, 2015, 5:05:37 PM1/5/15
to cython...@googlegroups.com
bump

thanks to wheezy-backports being successfully broken on per Dec 26, 2014 (package says it's 0.19, binary reports 0.21.2) we cannot build debian packages anymore - current resort is to manually build 0.19

Ian Henriksen

unread,
Jan 5, 2015, 5:34:24 PM1/5/15
to cython...@googlegroups.com
Just a guess, but you probably need an empty `__init__.py` file there
to indicate that what's in the folder is actually a Python module.

Michael Haberler

unread,
Jan 5, 2015, 6:43:28 PM1/5/15
to cython...@googlegroups.com
Ian,


On Monday, January 5, 2015 11:34:24 PM UTC+1, Ian Henriksen wrote:
Just a guess, but you probably need an empty `__init__.py` file there
to indicate that what's in the folder is actually a Python module.

thanks, that did the trick!

- Michael
Reply all
Reply to author
Forward
0 new messages