Re: python3 package import difference?

Liste des GroupesRevenir à cl python 
Sujet : Re: python3 package import difference?
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.python
Date : 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).

Date Sujet#  Auteur
7 Aug 24 * python3 package import difference?5Tobiah
7 Aug 24 +- Re: python3 package import difference?1Stefan Ram
8 Aug 24 +- Re: python3 package import difference?1Ronaldo Sc
8 Aug 24 +- Re: python3 package import difference?1Chris Angelico
8 Aug 24 `- Re: python3 package import difference?1Cameron Simpson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal