Sujet : python3 package import difference? De : toby (at) *nospam* tobiah.org (Tobiah) Groupes :comp.lang.python Date : 07. Aug 2024, 16:35:36 Autres entêtes Organisation : A noiseless patient Spider Message-ID :<v90488$35uk5$1@dont-email.me> User-Agent : Mozilla Thunderbird
I have an old library from 20 some years ago for use with python2, that is structured like this: rcs ├── dbi │ ├── __init__.py │ ├── dbi.py │ └── regos.py └── __init__.py -- *empty* the __init__.py file under 'rcs' is empty. The one under rcs.dbi contains: from dbi import * from regos import * With python2, I'd go: import rcs.dbi then I'd have access to stuff in regos.py as: rcs.dbi.feature() (Where 'feature' is defined in regos.py) When I do the same import with python3, I get: Traceback (most recent call last): File "/home/toby/me", line 1, in <module> import rcs.dbi File "/usr/regos-1.0/lib/python/rcs/dbi/__init__.py", line 1, in <module> from dbi import * ModuleNotFoundError: No module named 'dbi' What's changed, and how do I fix it? Thanks!