Django.conf module not found, why?

后端 未结 4 1453
清酒与你
清酒与你 2021-01-05 14:34

I\'m trying to install the Evennia Python MUD and when I get to the python manage.py syncdb command I get the below message... any ideas on why?

Traceback (m         


        
相关标签:
4条回答
  • 2021-01-05 14:43

    An ImportError exception happens when Python cannot import a particular module. Usually it's because that module doesn't appear in your PYTHONPATH environment variable.

    So, in your case, you need to add the path to django.conf to your PYTHONPATH.

    Here's a great write-up on several different ways of accomplishing this:

    http://docs.webfaction.com/software/python.html#importerror

    Edited: corrected typo--django.conf should be added to the path, not evennia.py, thanks Yuji.

    0 讨论(0)
  • 2021-01-05 14:48

    Remove the .pyc files using the command

    find . -name "*.pyc" -exec rm -f {} \;
    

    and test again.

    0 讨论(0)
  • 2021-01-05 14:50

    You will get this if you just haven't installed Django.

    e.g.

    pip install django
    
    0 讨论(0)
  • 2021-01-05 15:01

    Its hard to do manual stuff of changing the path and might create some more problems so instead go to your environment and delete "bin" folder and "pip-selfchek.json" now re-create your env with whatever method you want to use. i generally use

    virtualenv -p python3 <envname>
    

    now activate the env, and check all your package by

    pip freeze
    

    all good to go.

    0 讨论(0)
提交回复
热议问题