Python Forum
Installation of Python 2.7.x
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installation of Python 2.7.x
#1
Hello All,
I want to install Python 2.7.x on Linux as AWS Redshift is compatible with this version.

The current Linux already have one version of Python installed (2.6.6).
Linux version is GNU/Linux.

Please let me know whether we can upgrade the existing(default) version from 2.6.6 to 2.7.x.
If not then how can we install 2.7.x version on the same machine without breaking default installed Python version.

Thanks,
Akshay
Reply
#2
Did you try sudo apt-get install python2.7?
Reply
#3
It seems it will upgrade the by default version of Python to 2.7 installed in Linux.
And it is not advisable.
So please let me know whether above command will install 2.7 without upgrading the default Python version on Linux.
Reply
#4
What is the output of:

which python
Or
which python2

And then, use ls on that output folder:
ls -la /FOLDER/ | grep python


For now...
I created a docker image with ubuntu and added the ppa:
sudo add-apt-repository ppa:deadsnakes
And with it I installed 2.6 and then 2.7 and 3.6:
sudo apt-get install python2.6 python2.7 python3.6

Now I got all these python versions:
Output:
root@e2d21deb2627:/# python python2.6 python2.7 python3 python3.6 python3.6m python3m root@e2d21deb2627:/# python2.6 Python 2.6.9 (default, Apr 29 2018, 12:56:59) [GCC 7.3.0] on linux4 Type "help", "copyright", "credits" or "license" for more information. >>> exit() root@e2d21deb2627:/# python2.7 Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> exit() root@e2d21deb2627:/# python3 Python 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit() root@e2d21deb2627:/#
Reply
#5
Hello,
I need python version 2.7.x to be installed in Linux as it is compatible with Amazon Redshift.
So could you please provide me step by step guide how I can install the python version without disturbing default version and use it further.
Thanks.
Reply
#6
Ok, but we need more info about your system.

Post the outputs of these commands:

Which OS is running there?
uname -a

Which python?
which python

Which python libraries are installed?
find /usr/lib/ -name "libpython*"
Reply
#7
uname -a
Linux .x86_64 #1 SMP Thu Apr 26 04:27:41 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux

which python
/usr/bin/python


find /usr/lib/ -name "libpython*"
No Result
Reply
#8
One last test...

ls -la /usr/bin/python*

And I made some tests here and I'm pretty sure that if you use:

sudo apt-get install python2.7

The system will keep the python2.6 and get the new file for the python2.7.
Reply
#9
Thanks for the kind support!
Below is the output of ls -la /usr/bin/python*

/usr/bin/python
/usr/bin/python2 -> python
/usr/bin/python2.6

Please help me with below additional points.
1. How do I validate that Linux default version is not affected due to installation on 2.7.x.
2. How to view two Python versions are installed in parallel.
3. I need to install other software on Python 2.7.x, so how would I choose Python 2.7.x while installation and validate it after installation.

Thanks,
Akshay
Reply
#10
Quote:1. How do I validate that Linux default version is not affected due to installation on 2.7.x.
The version 2.7 of python will be installed besides the other installations as /usr/bin/python2.7
And you'll have to use python2.7 my_script.py to run your 2.7 scripts.

Quote:2. How to view two Python versions are installed in parallel.
You will have to check for the interpreter in the source folders in your PATH.

Quote:3. I need to install other software on Python 2.7.x, so how would I choose Python 2.7.x while installation and validate it after installation.
Just use the corresponding pip(2.7) to install the package/modules for your 2.7 scripts (applications).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python installation for old MacOS Yonix 1 498 Sep-21-2023, 03:32 PM
Last Post: menator01
  Installation of packages to newest Python version from previous one Andrzej_Andrzej 3 846 Jul-15-2023, 11:32 AM
Last Post: snippsat
  How to see the date of installation of python modules. newbieAuggie2019 4 1,639 Mar-31-2023, 12:40 PM
Last Post: newbieAuggie2019
  Getting "SSL client not supported by this Python installation" error prabirsarkar 0 966 Mar-13-2023, 05:01 PM
Last Post: prabirsarkar
  python installation/running inside singularity container erdemath 2 1,807 Sep-21-2022, 08:13 AM
Last Post: erdemath
Question Python V3.11 Installation Help Danno 2 1,109 Aug-11-2022, 02:30 AM
Last Post: Danno
  Portable installation of Python possible? pstein 2 3,099 Nov-15-2020, 12:14 PM
Last Post: snippsat
  python and openCV installation dejhost 16 10,850 Aug-04-2020, 02:23 AM
Last Post: snippsat
  No Scripts File present after python installation ag2207 5 4,926 Jul-30-2020, 11:11 AM
Last Post: buran
  Cannot find Python installation folder when I install Anaconda bsbsbsbs 1 2,226 Jul-14-2020, 03:14 PM
Last Post: dgrunwal

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020