简体   繁体   中英

cannot build up a django project

every time I tried to build a django project. I have no initialized files like manage.py in my project.

Then I tried to create the project on command line, I got this:

C:\Python34\Lib\site-packages\Django-1.9.3-py3.4.egg\django\bin> python .\django-admin.py startproject "MySite"

Traceback (most recent call last):
  File ".\django-admin.py", line 2, in <module>
    from django.core import management
  File "C:\Python34\lib\site-packages\django-1.9.3-py3.4.egg\django\core\management\__init__.py", line 10, in <module>
    from django.apps import apps
  File "C:\Python34\lib\site-packages\django-1.9.3-py3.4.egg\django\apps\__init__.py", line 1, in <module>
    from .config import AppConfig
  File "C:\Python34\lib\site-packages\django-1.9.3-py3.4.egg\django\apps\config.py", line 6, in <module>
    from django.utils.module_loading import module_has_submodule
  File "C:\Python34\lib\site-packages\django-1.9.3-py3.4.egg\django\utils\module_loading.py", line 67, in <module>
    from importlib.util import find_spec as importlib_find
ImportError: cannot import name 'find_spec'

Somebody could help me? I really appreciate your help. ps: python3.4, django_1.9

您需要将代码放在这里,因为看来您有太多导入错误

You are trying to create a Django project from within your Python installation ( C:\\Python34\\Lib\\site-packages\\Django-1.9.3-py3.4.egg\\django\\bin> ).

Try going to your home directory and trying there. django-admin should be in C:\\Python34\\Scripts\\ and that should be in your PATH so you should be able to call it from anywhere.

PS Use virtualenv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM