Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

importerror: No module named django

Tags:

django

I installed python 2.6 alongside my mac's 2.5.2 version. As soon as I did, python2.6 manage.py runserver failed because it couldn't find django.core.management.

From a shell, import django returns importerror: No module named django.

Why?

like image 320
Alex Avatar asked Feb 19 '10 21:02

Alex


2 Answers

Did you reinstall Django?

This happens when I install side by side versions of Python on Gentoo. Whenever I install a new version, I have to either reinstall the new ones or make a symlink to the old site-packages.

like image 166
Esteban Küber Avatar answered Nov 15 '22 07:11

Esteban Küber


Because each installation of Python uses its own directory to store libraries. On a Mac, they are in /Library/Python/2.x/site-packages/. Presumably you originally installed Django in the 2.5 directory, but it isn't yet in the 2.6 one. You can symlink it there if you want to, or reinstall it using the new version.

like image 21
Daniel Roseman Avatar answered Nov 15 '22 08:11

Daniel Roseman