2016-12-21 1 views
0
C:\Python27\Scripts>django-admin startproject python_tutorial 
Traceback (most recent call last): 
    File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main 
    "__main__", fname, loader, pkg_name) 
    File "c:\python27\lib\runpy.py", line 72, in _run_code 
    exec code in run_globals 
    File "C:\Python27\Scripts\django-admin.exe\__main__.py", line 9, in <module> 
    File "c:\python27\lib\site-packages\django\core\management\__init__.py", line 367, in execute_from_command_line 
    utility.execute() 
    File "c:\python27\lib\site-packages\django\core\management\__init__.py", line 316, in execute 
    settings.INSTALLED_APPS 
    File "c:\python27\lib\site-packages\django\conf\__init__.py", line 53, in __getattr__ 
    self._setup(name) 
    File "c:\python27\lib\site-packages\django\conf\__init__.py", line 41, in _setup 
    self._wrapped = Settings(settings_module) 
    File "c:\python27\lib\site-packages\django\conf\__init__.py", line 97, in __init__ 
    mod = importlib.import_module(self.SETTINGS_MODULE) 
    File "c:\python27\lib\importlib\__init__.py", line 37, in import_module 
    __import__(name) 
ImportError: Import by filename is not supported. 

Kann jemand bitte vorschlagen, was zu tun ist?Ich erhalte einen Fehler beim Erstellen von Python Django Projekt

+0

Mögliches Duplikat von [Django/Python-Fehler. "ImportError: Import nach Dateiname wird nicht unterstützt."] (Http://stackoverflow.com/questions/34481102/django-python-error-importerror-import-by-filename-is-not-supported) –

+0

Keine Ahnung, nur einige Vermutungen - verwenden Sie mehrere Python-Versionen? Haben Sie eine DJANGO_SETTINGS_MODULE Umgebungsvariable? Verwenden Sie virtualenv oder nicht? – RemcoGerlich

Antwort

0

Aus Versehen habe ich die Variable "DJANGO_SETTINGS_MODULE" auf den Python-Pfad gesetzt und es hat versagt. Ich habe diese Umgebungsvariable gelöscht und es funktioniert.

Verwandte Themen