osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Import module from a different subdirectory


On 2019-05-18 09:43:34 -0700, Rich Shepard wrote:
> The project layout, briefly, is:
> 
> ~/development/business-tracker/
                ^^^^^^^^^^^^^^^^
> 	classes/
> 	gui/
> 
> All subdirectories contain a __init__.py file to identify them as packages.
> 'classes/' contains model.py; 'gui/' contains test_act_de.py.
> 
> The project root directory is present in both PYTHONPATH and sys.path:
> 
> $ echo $PYTHONPATH
> /home/rshepard/development/bustrac/
                             ^^^^^^^

This won't help much if your directory named "business-tracker" (see
above).

        hp

-- 
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp at hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20190519/a37a93b3/attachment.sig>