Thursday, October 27, 2011

Re: No module named django after upgrade to os x Lion

Mac OS has always carried multiple Python installs. You can start
python using python2.5, python2.6, and on Lion python2.7. Those
installs are under /System/Library/Frameworks/Python.framework/ but
links to the executables are in /usr/bin/.

When you install Python packages, they get installed in /Library/
Python/VERSION#/site-packages/, so your django install is probably
under the 2.6 directory. Python 2.6 was the default python on Snow
Leopard - I believe Python 2.7 is the default on Lion and django isn't
installed in that directory which is why it stopped finding it.

Just FYI...

jay

On Oct 27, 8:30 am, angelika <angelika.ols...@gmail.com> wrote:
> Thanks, Tom. I see. So basically I need to reinstall Django, if I want
> to run it on Python 2.7.1, is that it?
>
> As far as I can tell, the older versions of Python are still installed
> on my machine. Does that mean that it might be possible to run an
> older version instead, and not have to reinstall Django? Can I run
> different versions of Python on the same machine, and just switch
> between the two?
>
> /Angelika
>
> On Oct 27, 11:28 am, Tom Evans <tevans...@googlemail.com> wrote:
>
>
>
>
>
>
>
> > On Thu, Oct 27, 2011 at 7:17 AM, angelika <angelika.ols...@gmail.com> wrote:
> > > Hello,
>
> > > I'm new to both Python and Django. A few months ago, I installed
> > > Django on my mac (running Snow Leopard). I took me quite some time,
> > > but I got it running. After that I didn't get around to doing anything
> > > with it. A few weeks ago, I upgraded my mac to run Lion and now, when
> > > I type import django in the python interpreter, it says No module
> > > named django.
>
> > > I found someone who had had a similar problem, and I'm guessing it
> > > could be connected to the fact that Lion comes with Python 2.7.1? My
> > > Django version is 1.2.5. Again, I know almost nothing about Python, so
> > > I could be way off base. Any ideas how I can solve this, or find out
> > > what the problem is?
>
> > > /Angelika
>
> > Python packages are installed for a specific minor version of python.
> > If you upgrade your minor version of python, then you will need to
> > reinstall all the python packages you use for that specific minor
> > version of python.
>
> > By 'minor version', I mean this: Python 2.7.1 has major version 2,
> > minor version 7 and minor minor version 1. You need to reinstall
> > whenever you change major or minor version.
>
> > Cheers
>
> > Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment