I am literally trying half a day to upgrade my python from 2.6 to 2.7 with no luck so far.
The linux distribution is:
Red Hat Enterprise Linux Server release 6.5 (Santiago), and it came with
python 2.6, which I want to now upgrade to
Here's the thing though; I already wrote huge amount of script lines in
python 2.6, until I finally caved in to the need to use newer version of python. So I already have a lot of packages (
dill and more...), installed with
pip install PACKAGE to my
python 2.6 script.
When I finally figured out how to install python 2.7 (I'll add the commands for reference):
$ wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz --no-check-certificate $ tar xf Python-2.7.6.tar.xz $ cd Python-2.7.6 $ ./configure $ make $ sudo make altinstall
I ran into some more problems...
First of all,
python 2.7 was installed in
python 2.6 is at
/usr/bin/python2.6. Naively, I thought that installing
python 2.7 will upgrade(=overwrite) the existing
python 2.6. So when typing
python from shell, the interpreter used is still
python 2.6, instead of the newly installed
pip install PACKAGE still tries to install the package for
$ pip install filelock DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6 Requirement already satisfied (use --upgrade to upgrade): filelock in /usr/lib/python2.6/site-packages
btw, I noticed that
/usr/bin has both
easy_install in it, unlike
/usr/local/bin/ (just in case this info can help solving this issue).
How do I solve these two issues?
python 2.7 to be picked whenever you type
python from shell, preferably taking
python 2.6's place in
pip to install packages for
I tried a lot of the suggested answers that seemed related, both here and in SO, but nothing seems to work for me.