I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But now when I run django-admin.py I get the following error. How can I resolve this?
Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\django\bin\django-admin.py", line 2, in <module>
from django.core import management
ImportError: No module named django.core
I'm sure it's related to something incorrect in my setup, but I am having the same problem, and it works properly if I call it thusly
I had the same problem in windows xp. The reason was i installed multiple python versions(2.6,3.2).windows's PATH is set correctly to python26, but the .py file is associated with python32. I want the .py file is associated with python26.To solve it, the easit way is to right click the *.py(such as django-admin.py),choose "open with"->"choose program..."->"Browse..." (select c:\python26\python.ext)->"Ok". Then we can run django-admin.py in the cmd without the need for the expatiatory prefix "c:\python26\lib\site-packages\django\bin".
Small quick fix is just to create symlink
ln -s $SOMEWHERE/lib/python2.6/site-packages/django/ ./django
I realized this happen because I didn't run
python setup.py install
. That setup the environment.This worked for me with bitnami djangostack:
I know that this is an old question, but I just had the same problem, in my case, it was because the I am using virtualenv with django, but .py file extensions in Windows are associated with the main Python installation, so running the django-admin.py are directly from the command prompt causes it run with the main Python installation without django installed.
So, since i dont know if there is any hash pound equivalent in Windows, I worked around this by running python followed by the full path of the django-admin.py, or you can also modify the virtualenv batch script to change the file associations and change it back when you deactivate it (although I am not sure how to do it, as I am not really familiar with batch script).
Hope this helps,