Atma
Atma

Reputation: 29767

how to point django website to python version besides default on centos

I am using Centos and have installed python 2.7 so that I can run django 1.7.

I installed python 2.7 according to https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4

The final installation step has me installing python using:

make altinstall instead of: make install

So that it doesn't replace the default os version of python.

How do I use the new version of python 2.7 instead of the old version?

Since invoking python , by default goes to the old default version, my django app doesn't point to the new version.

Please help.

Upvotes: 1

Views: 228

Answers (1)

Vitaly Isaev
Vitaly Isaev

Reputation: 5805

I would suggest you to:

  1. Install new python in any directory (e.g. /opt, /home/<you>, etc) that you're allowed to use (since you're on Centos, there should be a plenty of SELinux restrictions on executables...)
  2. virtualenv -p <path/to/fresh/python> <path/to/new/virtualenv/> (see here the full discussion)

Upvotes: 1

Related Questions