问答详情
源自:2-3 初始Django应用

用老师的方法,新建不了应用!怎么办???

(base) JACKWONGdeMBP:django_introduction jackwong$ python manage.py startapp blog

Traceback (most recent call last):

  File "manage.py", line 10, in main

    from django.core.management import execute_from_command_line

ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "manage.py", line 21, in <module>

    main()

  File "manage.py", line 16, in main

    ) from exc

ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

(base) JACKWONGdeMBP:django_introduction jackwong$ 


提问者:慕斯卡6507035 2019-07-02 19:46

个回答

  • 某喵啊喵的Tron
    2019-07-03 08:36:14

    base指的是anaconda里面的第一个环境(venv),如果你本机需要的是另一个python环境,那么你应该直接打开终端使用,如果在base环境里面安装了django,那显示base就是没错的,你这个错误可能是在安装anaconda的时候没有勾选添加到系统环境变量

  • 慕斯卡6507035
    2019-07-02 19:48:35

    自从安装了anaconda之后,终端就出现了一个(base),之前可以正常使用django的。怎么办