Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: robert Newsgroups: de.comp.lang.python Subject: [Python-de] =?utf-8?q?Verst=C3=A4ndnis-Problem_mit_python3_impor?= =?utf-8?q?t?= Date: Thu, 1 Mar 2018 10:38:08 +0100 Lines: 52 Message-ID: References: <8df4c688-813f-74c4-9523-f9ed0a4b00ae@redcor.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de BOsD02/+alYU0VTJxvIxVQ8CBdCajAWDRXkrhjSrJLNg== Return-Path: X-Original-To: python-de@python.org Delivered-To: python-de@mail.python.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Content-Language: en-GB X-BeenThere: python-de@python.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Die Deutsche Python Mailingliste List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <8df4c688-813f-74c4-9523-f9ed0a4b00ae@redcor.ch> Xref: csiph.com de.comp.lang.python:5127 Hoi z=C3=A4me, Ich bin dabei ein Aplikation von 2.7 nach 3.6 zu migrieren. Nun habe ich ein Problem den Mechanismus von Python 3.6 import zu versteh= en. in einem modul config habe ich eine __init__.py datei. Die beginnt so: # -*- encoding: utf-8 -*- import os import sys from . import globaldefaults GD =3D globaldefaults.GLOBALDEFAULTS from globaldefaults import GLOBALDEFAULTS wenn ich das modul in 2.7 lade funktioniert es wie gew=C3=BCnscht, nicht = aber in 3.6 robert@chrissy:~/bridge-builder$ python3.6 Python 3.6.4 (default, Jan 28 2018, 17:52:01) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import config Traceback (most recent call last): =C2=A0 File "", line 1, in =C2=A0 File "/home/robert/bridge-builder/config/__init__.py", line 6, in= =C2=A0=C2=A0=C2=A0 from globaldefaults import GLOBALDEFAULTS ModuleNotFoundError: No module named 'globaldefaults' was mich hier verbl=C3=BCfft, ist dass ich from . import globaldefaults GD =3D globaldefaults.GLOBALDEFAULTS ausf=C3=BChren kann, nicht aber from globaldefaults import GLOBALDEFAULTS was mach ich da falsch?? danke robert