- How to Install Python 2.7.18 on Ubuntu & LinuxMint
- Step 1 – Prerequisites
- Step 2 – Download Python 2.7
- Step 3 – Compile Python Source
- Step 4 – Check Python Version
- Related Posts
- How to Switch Python Version in Ubuntu & Debian
- Working with Python Functions
- How To Install PIP on Debian 11 Linux
- 47 Comments
- How to Install Python on PIP on Linux Mint
- Python PIP Linux Mint Installation Guide
- 1. Launching Terminal
- 2. Installing Setup Tools
- 3. Installing Python PIP
- 4. Testing PIP
- 5. Installing Anaconda Python
- Linux Mint Forums
- how to install python 2.7.10
- how to install python 2.7.10
- Re: how to install python 2.7.10
- Re: how to install python 2.7.10
- Re: how to install python 2.7.10
- Re: how to install python 2.7.10
- Re: how to install python 2.7.10
How to Install Python 2.7.18 on Ubuntu & LinuxMint
This article will help you to install Python 2.7.18 on your Ubuntu, Debian and LinuxMint operating systems. At writing time of this article Python 3.4.5 latest stable version is available to download and install.
To install Python 3.4.5 visit following article.
Step 1 – Prerequisites
You must have installed the following prerequisites on your system. Execute the following commands on your system to install all required dependencies to build Python 2.7.
Step 2 – Download Python 2.7
Download Python using following command from python official site. You can also download latest version in place of specified below.
Now extract the downloaded package.
Step 3 – Compile Python Source
Use below set of commands to compile Python source code on your system using altinstall.
make altinstall is used to prevent replacing the default python binary file /usr/bin/python.
Step 4 – Check Python Version
Check the latest version installed of python using below command
Related Posts
How to Switch Python Version in Ubuntu & Debian
Working with Python Functions
How To Install PIP on Debian 11 Linux
47 Comments
Reis helal lan.
Nice work.
Thank you very much, it worked without any issue.
Step 1 doesn’t work for Linux Mint 20.
[email protected]:
$ sudo apt-get install build-essential checkinstall
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt –fix-broken install’ to correct these.
The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:9.2) but it is not going to be installed
python-gtk2 : Depends: python (= 2.7)
Depends: python-numpy (>= 1:1.13.1) but it is not going to be installed
Depends: python-numpy-abi9
Depends: python:any (>= 2.6.6-7
)
E: Unmet dependencies. Try ‘apt –fix-broken install’ with no packages (or specify a solution).
[email protected]:
Being a beginner at this, I have no idea how to proceed.
Thanks, I have updated the URL.
Works great thanks! but how then to install new packages and liberaries with pip install?
Thanks a lot Rahul.
Thank you a lot!
Thanks,
nicely install but it’s ,python2.7.16 not the default. default one is 3.6.8. How I can make default python2.7.16 . Please let me know.
Hi, I will not suggest you change the default Python version. Changing the default Python may break the working of many application or entire operating system.
Worked like a treat.
In my case, the default python version for Ubunu got rekt, so apt could not function. I followed your process and used install instead of altinstall, because I needed to replace a broken 2.7.x default. Saved me re-installing Ubuntu
I have compleated all steps but it still shows 2.7.6 ?
Thanks a lot, It really helped me!
Hello sir, Thank u for such great tutorial…
It helped me alot.
Once again thank you 🙂
In step 2 I tried Downloading Python using the following command from python official site but i get HTTP request sent, awaiting response…404 Not found
Please consider that many patches are applied, and one important is the platform.py allowing to detect the ubuntu release version.
You can see a set of diff on the right side, named [python2.7_2.7.12-1ubuntu0
Very Clear…Great one.
excuse me for wondering that how to cleanly remove them after installing because “make uninstall* seems not available
very straightforward setup for Windows Ubuntu Subsystem! Cheers!
Clean, sharp instructions, thanks kid 🙂
Awesome, you’re a lifesaver. They have python 2.14 now so if you just replace all the commands that have “2.7.13” with “2.7.14” it works fine
Thanx, this worked – Got Python 2.7.14 working on an older Linux version, which runs on a laptop. Looks nice, but of course, no pip, and no image library. Working on getting these… But again, thanx. Previous Python version was 2.5, and now at least I have 2.7.14, from http://www.python.org, compiled from source, which was my objective. FYI: THe source download was in a .tar.xz form, and I did not have the xz-utils on my Linux version. I had to scp the python-2.7.14.tar.xz file over to a current CentOS box, run the “unxz” utility to decompress the 12 mb file into a 71 mb file, and scp it back to the laptop, where I could then do the ./configure, make and make install (I wanted to overwrite the old Python version). Looks like it all worked. Trick now is to get the image stuff and pip, which should be somewhere… (if it exists, it has to be somewhere, no?) 😉
This was very helpful. I’m new to python and this worked on the first try.
This fails when I get to step “wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz“.
This is what I get:
–2017-10-29 20:20:38– https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
Resolving http://www.python.org (www.python.org)… 151.101.84.223, 2a04:4e42:14::223
Connecting to http://www.python.org (www.python.org)|151.101.84.223|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 17076672 (16M) [application/octet-stream]
Python-2.7.13.tgz: Permission denied
Hi, It looks you are facing issue with downloading file under /usr/src directory. Kindly switch to superuser to run commands or use sudo. I have updated the tutorial with sudo commands.
hello sir , i followed d your above step in my system. but when i type a command python -V in terminal its display older version(2.7.6).
equals, version wasn’t replace
Thanks dude, this worked a treat!
I followed instructions on Linux Mint Cinnamon 17.3 and ended up with latest python, but missing crucial modules like datetime and time.
Thanks for the article.
i would suggest running sudo apt-get update
before running the first two commands
If you are on Linux you will most likely need to add
–enable-unicode=ucs4
to the arguments of ./configure to keep it consistent with the ‘standard’ builds.
I get
E: Unable to locate package checkinstall
Thank you…. great!!
Thank you so much!
Great this was very helpful. One issues i found. I believe you need to run a: ‘sudo make’ command and allow that to run before you run the sudo make altinstall command.
Otherwise worked perfectly for me.
Источник
How to Install Python on PIP on Linux Mint
Python PIP Linux Mint Installation Guide
You are Welcome! The Tutorial Shows You Step-by-Step How to Install the Python 3.x and Python 2.x PIP Package Manager and Setuptools with easy_install on Mint GNU/Linux.
And the Python PIP for Linux Mint is the Python Package Manager used to Install and Manage Software Packages written in Python 2/3.
Especially Relevant: to Work with Python for Science, Engeneering and Data Analisys is Now Preferred instead to Install PIP with Anaconda Python!
Finally, the guide includes instructions on How to Install Anaconda Python on Linux Mint.
1. Launching Terminal
Open a Shell Terminal emulator window
(Press “Enter” to Execute Commands)
2. Installing Setup Tools
First, to Install Python Setup Tools:
3. Installing Python PIP
Then to Install PIP:
Or of ‘permission denied’ issue then use sudo command like:
4. Testing PIP
Finally, to Test Python PIP Setup
For Python3 run:
And for Python2 instead:
5. Installing Anaconda Python
How to Install Anaconda Python on Mint
Источник
Linux Mint Forums
Welcome to the Linux Mint forums!
how to install python 2.7.10
how to install python 2.7.10
Post by dagins » Mon Sep 28, 2015 5:17 am
I develop some project on my pc with mint 17. Here is Python 2.7.6 installed, but on my production server I have Python 2.7.10. Differenced between these two versions are enough for my project on production server to stop working sometimes, what is unacceptable.
The install process (sudo make altinstall) ends with an error:
After this, I can access Python 2.7.10 from console, but that’s all. Nothing else works, including Idle or mintinstall, after linking new python bin to /usr/bin/python.
How can I safetly upgrade Python without breaking the OS, so I don’t experience surprises after deploying my new project versions on production server?
Re: how to install python 2.7.10
Post by xenopeek » Mon Sep 28, 2015 6:54 am
That’s a common mistake, though most folks seem to run into problems like yours by installing a newer Python 3 and linking that to /usr/bin/python. In short, /usr/bin/python is used by system software. Don’t touch it
It would be better to link a new python bin as something like /usr/bin/python2.7.10. Then in your scripts start with:
Re: how to install python 2.7.10
Post by dagins » Mon Sep 28, 2015 12:28 pm
Can you please tell me why I can’t install shared libs with sudo ./configure —enable-shared flag (I mean, I can execute this config, but sudo make altinstall fails afterwards)? Without these libraries, I am not able to turn on my project.
When I try to enable them, the error written above occurs, and instead of python 2.7.10, version 2.7. 6 is being installed — what is a riddle to me. And even with this incorrect version installed, I am still not able to turn on my project (with some different errors), what makes me unable to continue my work.
Re: how to install python 2.7.10
Post by xenopeek » Mon Sep 28, 2015 12:44 pm
I followed this guide and it works for me on Linux Mint 17.2: http://tecadmin.net/install-python-2-7- . linuxmint/. I only needed to add «sudo» prefix to the wget and tar commands to make it work.
After compilation testing the versions:
Re: how to install python 2.7.10
Post by dagins » Mon Sep 28, 2015 12:55 pm
Re: how to install python 2.7.10
Post by dagins » Mon Sep 28, 2015 2:18 pm
Okay, after a long hell march, I’ve partially figured out what’s wrong.
When I use ldd on new Python 2.7.10 binary, I see wrong path to the shared library:
It is a system library insead of the one freshly created at /usr/local/lib.
I’ve renamed it to OLD_libpython2.7.so.1.0 and copied new lib on its place.
It works — after reboot, nothing suspicious happened, although this way seems to be a bit dirty.
On stackoverflow, some people suggested to set LD_LIBRARY_PATH to /usr/local/lib before compilation, but it doesn’t work.
Also, wrong version of python was displayed when compiled with —enable-shared because of this wrong library.
@edit
It actually broke something — my vim plugins stopped working. I will have to find another way to enforce compiler to pick shared library from /usr/local/lib.
Источник