0

I am using Django on my Mac OS X server. Things are fine, so far. I have been using python 2.6.1 and all works well. I upgraded Python to version 2.7.3. Invoking python in the terminal brings up version 2.7.3, as expected. Checking Django using the {% debug %) reveals that Django is still using the original python 2.6.1 interpreter.

On this system, /usr/local/bin contains a symlink to ../../../Library/Frameworks/Python.framework/Versions/2.7/bin/python

In /usr/bin I find the python interpreter, and from that directory, invoking ./python gets python 2.6.1 running.

My $PATH is /Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/mysql/bin:/usr/local/bin

which I believe must have been altered on the python 2.7.3 install.

What is considered the optimal way to get the command line and Django using the same Python? I am considering either moving the framework version to /usr/bin and sitting a symlink in the framework to the moved new version. On the system is also a /Library/Python directory, that contains the site-packages for versions 2.3, 2.5, and 2.6. In /Library/Python/2.6/site-packages are the major goodies django, mercurial, and south.

Where are people putting things, nowadays? I mean, I know I could move things around, but I would like to anticipate where the Django project is going so future upgrades can go smoothly.

kd4ttc
  • 1,075
  • 1
  • 10
  • 28

2 Answers2

1

Install it against the updated Python.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • Thanks for the reply. If I reinstall django then it would seem that I will need to reinstall all other packages, like south, and mercurial as well as django. Isn't there a recommended structure for where the various packages and utilities are supposed to go? – kd4ttc Jul 17 '12 at 22:22
  • You'd still need to recompile all the bytecode for the new VM. – Ignacio Vazquez-Abrams Jul 17 '12 at 22:31
0

Consider putting your app within a virtualenv container and specifying the version of Python when you create it - as per: Use different Python version with virtualenv

Community
  • 1
  • 1
elithrar
  • 23,364
  • 10
  • 85
  • 104