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
Thanks for posting the question and answers. I have two versions of Python installed, but root was pointing to the /usr/bin version, and I wanted to use the 2.7 version of Python in /usr/local/bin. After rebuilding/reinstalling Django and mysqldb, all is well and I'm not getting the error.
If you are using Windows, then Don't run with 'django-admin.py', since this will call your outer python.exe to execute and it cannot read into the django inside the virtual environemnt. Try 'python django-admin.py' to use your python.exe inside your environment.
I had the same problem and recalled that I had installed iPython the previous afternoon. I uninstalled iPython and the problem went away. Incidentally, I am working with virtualenv. I had installed iPython in the system-wide site-packages directory, so I just re-installed iPython inside each virtualenv that I am using. After installing iPython yesterday I had noticed a warning message (from version 0.13 of iPython) that it had detected that I was using virtualenv and that if I ran into any trouble I should install iPyton inside each virtualenv.
If your path variables are correct and from the python shell you can do: from django.core import management , make sure you're including "python" before "django-admin.py" as such: python django-admin.py startproject thelittlethings
I just got the same ImportError in Windows Vista having Python 2.7 and 3.2 installed and using virualenv with Python 2.7 and Django 1.4.3.
I changed the file association of .py files in Explorer from 3.2 to 2.7. Rightclicking a .py file and changing settings. I still got the ImportError.
I ran
cmd.exe
as an administrator and copypasted the earlierftype
stuff. After an error, noted that double quotes don't get copied correctly from browser to cmd. Rewrote the command in cmd, but I still got the ImportError.In root of the actived virtual environment, I explicitly gave the
python
command and the path to django-admin.py from there.(env_p27) C:\Users\Gemmu\env_p27>python .\Scripts\django-admin.py startproject mysite
That worked.
Thanks for all the help for everyone.
You can get around this problem by providing the full path to your django-admin.py file