How do I install newer Python versions using apt-get?

1

As far as I can tell, at least in a docker container, one can definitively apt-get python 3.

First I ran into a ubuntu container with container:

docker run -it --rm ubuntu:latest bash

then for some reason it needed to update some ubuntu stuff so I did (inside the container):

apt-get update && apt-get install -y build-essential git libjpeg-dev

and then I simply installed python3 and it seems it automatically got python 3.5:

apt-get install python3 apt-get install python3-pip

and to test if pip works lets download something:

pip3 install tensorflow

all seems to work fine for me.

Important Note: it seems that if you already have python 3.4 installed then apt-get install python3 does not work because it says you already have it. It seems that was one of my problems because I was starting from a docker image from tensorflow (in particular gcr.io/tensorflow/tensorflow:latest-devel-py3) and something in that image (I assume its that they already...

0 0
2
...
0 0
3

The Easy Way

Open up 'Synaptic Package Manager' from the menu Search for 'python' in the 'Quick Search' field Select and install whatever versions of python you choose to use

To use a specific version of python (Ex. 2.4) just type python followed by the version number in the terminal:

python2.4 run_some_script.py

To install libraries to a particular version of python just run setup.py the same way.

Ex. Install to python2.5

python2.5 setup.py install

In this day and age, there's really no need to build from source or worry about dependency tracking on most programs unless you're developing it directly or you're using a bleeding-edge non-stable branch.

If the newer stable revisions of python aren't showing up in apt-get or synaptic, update your repository.

in Synaptic press ctrl-r in apt type 'apt-get update'

Note: You really should be able to get all the stable releases of python from 2.4 - 3.1 except 3.0 (because 3.0 has mainly been ditched...

0 0
4

by

Alex Ryan

Last Updated November 18, 2017 15:02 PM

I am stuck on Ubuntu 14.04 and upgrading to 15.10 is probably not an option. The highest version of python supported by Ubuntu 14 is 2.7.6.
This is very old. I want to install a newer version.

I understand that all I need is a .deb version of the software that I'd like to install. I think I just need to find a server that has this and added it to the list of repositories (/etc/apt/sources.list) and then apt-get will magically do the right thing.

However, I am going to want to break the rules and install newer versions of other software too. The more often I do this, the more likely bad things are to happen of course. However, I suspect that there are MANY people in my shoes who want to do the same thing. So maybe there is repository for rule breakers like myself can use to replace the official Ubuntu repositories?

Does such a magical repository exist?

If I add it to...

0 0
5

*********************************************************************************

Maybe you found it hard because you used a wrong procedure.

Felix Krull runs a PPA offering basically any version of Python (seriously, there is 2.3.7 build for vivid...) for many Ubuntu releases at https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes.

Do the usual:

sudo add-apt-repository ppa:fkrull/deadsnakes sudo apt-get update sudo apt-get install python3.5

It will not overwrite your existing python3.4 which is still symlinked as python3.

DON'T change the symlink! There are apparently many system functions that don't work properly with python3.5.

I tried this and afterwards couldn't open a terminal, software updater,...

cd /usr/bin sudo rm python3

The upgrade to Wily will adapt the meta-package python3 to point to python3.5. I don't expect any breakage, but at this point the foreign repository is not needed anymore. So to be really safe, you can...

0 0
6
How do I install Python 3.6 using apt-get in Ubuntu 16.04?

If you are using Ubuntu 14.04 or 16.04, you can use J Fernyhough’s PPA at https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.6 to install Python 3.6:

sudo add-apt-repository ppa:jonathonf/python-3.6 sudo apt-get update sudo apt-get install python3.6

If you are using Ubuntu 16.10, then Python 3.6 is in the universe repository, so you can just run

sudo apt-get update sudo apt-get install python3.6

—————————————–/OR/———————————————– Another way I would recommend pyenv to solve your woes. It doesn’t use Aptitude, and does involve “building it yourself”, but it’s fully automated. You can build and install a new (or old) version of Python by simply saying pyenv install 3.6.0. Everything runs just as your user, so you don’t have to worry about messing up the Python used by Ubuntu itself.

Install pyenv

Install headers needed to build Pythons: sudo apt-get install libbz2-dev libssl-dev libreadline-dev...
0 0
7

Use Apt-Pinning.

I'm not yet very used to this concept, but it seems to basically means that you configure your Debian system in a way such that you can install packages from stable, testing, untested (and potentially other repositories such as backports) directly using apt-get, without breaking (too much) the dependencies of the system, because by default it will use stable, and only when you want it it will search in the other repositories.

This is a very nice, ergonomic and safe way to update only some parts of a Debian system to the latest releases, without breaking the dependencies and the global stability of the system.

A nice tutorial about Apt-Pinning: http://jaqque.sbih.org/kplug/apt-pinning.html

I am using Lenny with Plesk on a dedicated virtual host, here's my config files, made on 2012-01-11:

apt.conf

APT::Cache-Limit "16777216";

sources.list

#Stable deb http://ftp.de.debian.org/debian lenny main contrib non-free deb...
0 0
8
install python 3 5 ubuntu - Page 1 - AirySoftware

Speed up you PC 300%

Home

>

install python 3 5 ubuntuHow do I install Python 3.6 using apt-get? - Ask Ubuntu Rating:6/10https://askubuntu.com/questions/865554/how-do-i-install-python-3-6-using-apt-get Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Location: San Francisco, California, United States Install OpenCV3 on Ubuntu | Learn OpenCV Rating:2/10https://www.learnopencv.com/install-opencv3-on-ubuntu/ In this post, we will provide step by step instructions for installing OpenCV 3 (C++ and Python) on Ubuntu. Location: Provo, Utah, United States 16.04 - How do I install python 3.5.2? - Ask Ubuntu Rating:6/10https://askubuntu.com/questions/798123/how-do-i-install-python-3-5-2 Jul 13, 2016 - sudo apt-cache show python3 sudo apt-get install python3= 3.5 .1* ... As you must have already...
0 0
9

Because I totally screwed up my python installation I manually deleted all the python files and am now trying to reinstall it.

When I type apt-get install --reinstall python2.7, I get this error message:

0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 0 not to upgrade. 3 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up python-minimal (2.7.3-0ubuntu2.2) ... /var/lib/dpkg/info/python-minimal.postinst: 4: /var/lib/dpkg/info/python-minimal.postinst: python2.7: not found dpkg: error processing python-minimal (--configure): subprocess installed post-installation script returned error exit status 127 Setting up python2.7 (2.7.3-0ubuntu3.4) ... /var/lib/dpkg/info/python2.7.postinst: 6: /var/lib/dpkg/info/python2.7.postinst: python2.7: not found dpkg: error processing python2.7 (--configure): subprocess installed post-installation script returned error exit status 127 dpkg: dependency problems prevent...
0 0
10

Python has got its own package managing facilities, in parallel to the one sets by the Linux distributions (including Ubuntu). The repository is the Pypi - Python Package Index, and packages are installed withpipor the easy_install script, which is part of Python's setuptools package.

As a rule of thumb, you should not use both the packages installed via pip/setuptools, and packages available to your distro (via apt-get, yum, urpmi, etc...) as they might conflict.

So, one of the less error prone way to deal with it is to have separate Python installs in your system - leave the python that came with the system for system scripts and such - on this python, make use of packages installed by your package manager only. And install other versions of Python (or even the same), to be run with "virtualenv"s - on these other install you install things with pip/setuptools only.

(And even if one opt to live boldly and not use virtualenvs, installing another python version...

0 0
11

Background:

I am using Ubuntu The newer python version is not in the apt-get repository (or synaptic) I plan on keeping the old version as the default python when you call "python" from the command line I plan on calling the new python using pythonX.X (X.X is the new version).

Given the background, how do you install a newer version of python and keep the older python version?

I have downloaded from python.org the "install from source" *.tgz package. The readme is pretty simple and says "execute three commands: ./configure; make; make test; sudo make install;"

If I do the above commands, will the installation overwrite the old version of python I have (I definitely need the old version)?

-------------Problems Reply------------

When you install from source, by default, the installation goes in /usr/local -- the executable in particular becomes /usr/local/bin/pythonX.Y with a symlink to it that's named /usr/local/python. Ubuntu's own...

0 0
12

I have ubuntu 10.04 with python2.6 by default. I have installed python2.7.

When I want to install python packages with

apt-get python-

it gets installed to python2.6. How can I make it to install the package to python2.7? Is there any option?

I have looked at this, but I could not find such directories in my OS. I have considered using easy_install-2.7, but not all packages are supported. For example python-torctl.

I am more interested in binding python2.7 with apt-get install.

Python has got its own package managing facilities, in parallel to the one sets by the Linux distributions (including Ubuntu). The repository is the Pypi - Python Package Index, and packages are installed with pip or the easy_install script, which is part of Python's setuptools package.

As a rule of thumb, you should not use both the packages installed via pip/setuptools, and packages available to your distro (via apt-get, yum, urpmi, etc...) as they might...

0 0
13

I have ubuntu 10.04 with python2.6 by default. I have installed python2.7.

it gets installed to python2.6. How can I make it to install the package to python2.7? Is there any option?

I have looked at this, but I could not find such directories in my OS. I have considered using easy_install-2.7, but not all packages are supported. For example python-torctl.

I am more interested in binding python2.7 with apt-get install.

Python has got its own package managing facilities, in parallel to the one sets by the Linux distributions (including Ubuntu). The repository is the Pypi – Python Package Index, and packages are installed with pip or the easy_install script, which is part of Python’s setuptools package.

As a rule of thumb, you should not use both the packages installed via pip/setuptools, and packages available to your distro (via apt-get, yum, urpmi, etc…) as they might conflict.

So, one of the less error prone way to deal with it is to have...

0 0
14

Image Result For How Do I Install Python Using Apt Get Ask


Ubuntu If you are using Ubuntu , you can use J Fernyhough s PPA at sudo add apt repository ppa jonathonf python . sudo apt get update sudo apt get install python Alternatively, you can use Felix Krull s .First, install some dependencies sudo apt get install build essential checkinstall sudo apt get install libreadline gplv dev libncursesw dev libssl dev libsqlite dev tk dev libgdbm dev libc dev libbz dev. Then download using the following command version= cd ~ Downloads wget .Type in your password no visual feedback due to security reason when it asks and hit Enter. . Then check updates and install Python . via commands sudo apt get update sudo apt get install python Now you have three Python versions, use python command for version ., python for version ., .Sudo apt get install y make build essential libssl dev zlibg dev sudo apt get install y libbz dev libreadline dev libsqlite dev wget curl llvm...

0 0
15

Quick installation of python3-gi:

Step 1: Update system:

sudo apt-get update

Step 2: Install: python3-gi

Ater updaing the OS run following command to install the packae:

sudo apt-get install python3-gi

How to install python3-gi on Ubuntu 12.04 LTS?

First of all update your system with the command:

sudo apt-get update

Ads

Above command will download the package lists for Ubuntu 12.04 LTS on your system. This will update the list of newest versions of packages and its dependencies on your system.

After downloading the latest package list with the help of above you can run the installation process.

If python3-gi is not installed on your compter then the command 'dpkg -L python3-gi' will give followin error.

deepak@deepak-VirtualBox:~$ dpkg -L python3-gi Package `python3-gi' is not installed. Use dpkg --info (= dpkg-deb --info) to examine archive files, and dpkg --contents (= dpkg-deb --contents) to list their...
0 0
16
H

ow do I install python an interactive high-level object-oriented language on Linux operating system?


Python runs on many operating systems such as MS-Windows, Mac OS, Mac OS X, Linux, FreeBSD, OpenBSD, Solaris, AIX, and many varieties of free UNIX like systems. The easiest way to install the Python is to use package manger such as apt-get, yum, and so on.

A note about Debian / Ubuntu Linux user

Use the following command to search for available versions of Python under Debian and Ubuntu Linux:
$ apt-cache search python | egrep "^python2.[0-9] " --color
Type the following command to install python version 2.x:
$ sudo apt-get install python2.6
Type the following command to install python version 3.x:
$ sudo apt-get install python3.1
Sample outputs:

Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: python3.1-minimal Suggested...
0 0
17

Several top universities around the globe use Python to introduce students to programming. The Massachusetts Institute of Technology (MIT), the University of Texas at Arlington, and Stanford are only a few examples of institutions that use this language extensively.

Additionally, it is important to note that Python is also useful for a wide variety of educational, enterprise, and scientific purposes – from web development to desktop applications to machine learning and everything in between.

Currently, there are two major Python versions in use – 2 and 3, with 2 rapidly losing grounds to 3 since the former is no longer under active development. Since all Linux distributions come with Python 2.x installed.

Suggested Read: Getting Started with Python Programming and Scripting in Linux – Part 1

In this article we will show how to install and use Python 3.x in CentOS/RHEL 7, Debian and its derivatives such as Ubuntu (latest LTS version already has latest...

0 0
18

This is going to be a tutorial on how to install tensorflow 1.4.1 GPU version. We will also be installing CUDA Toolkit 9.1 and cuDNN 7.0.5 along with the GPU version of tensorflow 1.4.1. At the time of writing this blog post, the latest version of tensorflow is 1.4.1.This tutorial is for building tensorflow from source. If you want to use the official pre-built pip package instead, I recommend another post, How to install Tensorflow 1.5.0 using official pip package.

Update: TensorFlow 1.5.0 has been officially released and the same process works for Tensorflow 1.5.0 as well. Just specify the correct URL for version 1.5.0 in step 11 in place of v1.4.1.

Tensorflow is an open source software library developed and used by Google that is fairly common among students, researchers, and developers for deep learning applications such as neural networks. It has both the CPU as well as GPU version available and although the CPU version works quite well, realistically, if you are...

0 0
19

The easiest way to get started is to download a pre-packaged Mininet/Ubuntu VM. This VM includes Mininet itself, all OpenFlow binaries and tools pre-installed, and tweaks to the kernel configuration to support larger Mininet networks.

Option 1: Mininet VM Installation (easy, recommended)

VM installation is the easiest and most foolproof way of installing Mininet, so it’s what we recommend to start with.

Follow these steps for a VM install:

Download the Mininet VM image.

Download and install a virtualization system. We recommend VirtualBox (free, GPL) because it is free and works on OS X, Windows, and Linux (though it’s slightly slower than VMware in our tests.) You can also use Qemu for any platform, VMware Workstation for Windows or Linux, VMware Fusion for Mac, or KVM (free, GPL) for Linux.

Sign up for the mininet-discuss mailing list. This is the source for Mininet support and discussion with the friendly Mininet...

0 0
20

To build lxml from source, you need libxml2 and libxslt properly installed, including the header files. These are likely shipped in separate -dev or -devel packages like libxml2-dev, which you must install before trying to build lxml.

The lxml.etree and lxml.objectify modules are written in Cython. Since we distribute the Cython-generated .c files with lxml releases, however, you do not need Cython to build lxml from the normal release sources. We even encourage you to not install Cython for a normal release build, as the generated C code can vary quite heavily between Cython versions, which may or may not generate correct code for lxml. The pre-generated release sources were tested and therefore are known to work.

So, if you want a reliable build of lxml, we suggest to a) use a source release of lxml and b) disable or uninstall Cython for the build.

Only if you are interested in building lxml from a checkout of the developer sources (e.g. to test a bug fix...

0 0