简体   繁体   中英

Problem with django after installing anaconda

I am working on a Django project and this is what I am getting when I try to run the server. It used to work totally fine but I think the path is missing for virtualenv. I installed anaconda yesterday and the path variable is changed in advanced system settings. How can I revert them back to original settings? Total python newbie here. Kindly help.

C:\Users\13157\django_project>python manage.py runserver
Traceback (most recent call last):
  File "manage.py", line 9, 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 20, in <module>
    main()
  File "manage.py", line 11, in main
    raise ImportError(
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?

C:\Users\13157\django_project>

这些是我目前的路径

If you already have the virtual environment created that has django installed, do: path_to_environment_folder\Scripts\activate .

If you don't have an existing environment, create one by using python3 -m venv environment and then activate it with environment\Scripts\activate . After that, install django with pip3 install django .

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