[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Got "ValueError: Attempted relative import in non-package" when use
From: |
Oleksandr Gavenko |
Subject: |
Re: Got "ValueError: Attempted relative import in non-package" when use ropemacs. |
Date: |
Wed, 29 Feb 2012 22:42:00 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
On 2012-02-28, Oleksandr Gavenko wrote:
> Recently I try use ropemacs and friends to simplify and speedup my coding
> experience in Python language.
>
> When all my code stay in single file - all ok. But when come time to split
> code to several files I get error:
>
> >>> Traceback (most recent call last):
> File "/tmp/py4140IWr", line 5, in <module>
> from .blogger import *
> ValueError: Attempted relative import in non-package
>
I ask at:
http://groups.google.com/group/rope-dev/browse_thread/thread/dd178d2ad0421e7a
and found that this problem come from "C-c C-c" command which does not related
to ropemacs...
So I have:
> File hierarchy:
>
> <root>/blog4y/blog4y.py
> <root>/blog4y/blogger.py
> <root>/blog4y/wordpress.py
>
<root>/blog4y/blog4y.py use relative imports:
> from .blogger import *
> from .wordpress import *
>
How to tell to Emacs *Python* that <root>/blog4y contain package 'blog4y' with
3 modules inside?
--
Best regards!