Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: python import error Date: Wed, 11 Dec 2013 16:15:57 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 28 Message-ID: References: <93405ea9-6faf-4a09-9fd9-ed264e3136e1@googlegroups.com> <58f7bd2a-ef82-4782-b4fb-db824f9c8e44@googlegroups.com> NNTP-Posting-Host: panix3.panix.com X-Trace: reader1.panix.com 1386778557 13884 166.84.1.3 (11 Dec 2013 16:15:57 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 11 Dec 2013 16:15:57 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:61595 In <58f7bd2a-ef82-4782-b4fb-db824f9c8e44@googlegroups.com> smilesonisamal@gmail.com writes: > > > File "aaa.py", line 5, in > > > > > from ccc.ddd import sss > > > > > ImportError: No module named ccc.ddd > > > > > directory structure as follows: > > > > > ccc > > > | > > > ddd > > > | > > > aaa.py > > > sss.py > > It is having __init__.py as blank in ccc and ddd directories. But it > still doesnot work. What directory are you in when you run your python command? As written, your import will only work if you're in the parent directory of ccc (or that directory is in your PYTHONPATH.) -- John Gordon Imagine what it must be like for a real medical doctor to gordon@panix.com watch 'House', or a real serial killer to watch 'Dexter'.