Noah R
Noah R

Reputation: 5477

Django.conf module not found, why?

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 (most recent call last):
  File "evennia.py", line 33, in ?
    from django.conf import settings
ImportError: No module named django.conf

Upvotes: 8

Views: 22739

Answers (4)

Mayank Jain
Mayank Jain

Reputation: 466

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.

Upvotes: 0

Asad Iqbal
Asad Iqbal

Reputation: 304

Remove the .pyc files using the command

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

and test again.

Upvotes: 2

scipilot
scipilot

Reputation: 7447

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

e.g.

pip install django

Upvotes: 1

Cloud Artisans
Cloud Artisans

Reputation: 4136

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.

Upvotes: 2

Related Questions