开发者

Django.conf module not found, why?

I'm trying to install the Evennia Python MUD and when I get to 开发者_如何学JAVAthe python manage.py syncdb command I get the below message... any ideas on why?

Traceback (most recent call last):
  File "evennia.py", line 33, in ?
    from django.conf import settings
ImportError: No module named django.conf


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.


Remove the .pyc files using the command

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

and test again.


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

e.g.

pip install django


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜