Sujet : Re: python3 package import difference?
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 07. Aug 2024, 23:00:13
Autres entêtes
Organisation : Stefan Ram
Message-ID : <import-20240807215947@ram.dialup.fu-berlin.de>
References : 1
Tobiah <
toby@tobiah.org> wrote or quoted:
File "/usr/regos-1.0/lib/python/rcs/dbi/__init__.py", line 1, in <module>
from dbi import *
ModuleNotFoundError: No module named 'dbi'
The directory of the outermost script executed is in the system path.
E.g., the directory "d" when you invoke "python d/s.py".
To see the system path:
import sys
print( sys.path )
. "dbi" should not be in any of those directories in the system path.
Therefore, it is not found!
You could use a relative import:
from .dbi import *
or manipulate the sys.path (or an "editable install" of dbi might
also help, but I'm not sure about this as I have not tested it).