How To Install Python3 On Ubuntu

Anaconda Python

  1. How To Install Python Packages
  2. How To Install Python On Ubuntu
is a Python distribution just like Ubuntu is a Linux distribution. Anaconda Python comes pre-installed with all the data science and machine learning tools. That’s why it’s great for people interested in those. In this article, I will show you how to install Anaconda Python on Ubuntu 18.04 LTS. Let’s get started.How To Install Python3 On Ubuntu

Downloading Anaconda Python:

Anaconda Python is not available in the official package repository of Ubuntu 18.04 LTS. But it can be downloaded from the official website of Anaconda Python.

To download Anaconda Python, first visit https://www.anaconda.com/download/#linux from any web browser of your choice and you should see the following page.

On Ubuntu 14.04 Python 3.4 is installed by default. As recommended by PEP-394 you can use python and python2 to run Python v2 (2.7) and python3 to run Python v3 (3.4). Python 3 is the most current version of the language and is considered to be the future of Python. This tutorial will guide you through installing Python 3 on a Debian Linux server and setting up a programming environment. Before you begin, you’ll need a server with Ubuntu 16.04, Debian 8, or another version of Debian Linux installed.

Anaconda Python is a Python distribution just like Ubuntu is a Linux distribution.Anaconda Python comes pre-installed with all the data science and machine learning tools. That’s why it’s great for people interested in those. In this article, I will show you how to install Anaconda Python on Ubuntu 18.04 LTS. Let’s get started. How To Install Python 3 and Set Up a Local Programming Environment on Ubuntu 18.04 July 9, 2018 Python is a flexible and versatile programming language that can be leveraged for many use cases, with strengths in scripting, automation, data analysis, machine learning, and back-end development. Install OpenCV 3.0 and Python 3.4+ on Ubuntu (and be sure to see this page if you’re looking for macOS and Raspberry Pi installation guides) The folks at Canonical have been working hard. Installing Python 3.6 on Ubuntu 16.10, Ubuntu 17.04 from Repository Python 3.6 is included in the universe repository of Ubuntu 16.10 and Ubuntu 17.04, so you can install it with the commands below. For both Ubuntu and Debian, we have ongoing project goals to make Python 3 the default, preferred Python version in the distros. This means: Python 3 will be the only Python version installed by default. Python 3 will be the only Python version in any installation media (i.e. Image ISOs) Only Python 3 will be allowed on the Ubuntu touch images.

As you can see from the screenshot below, Anaconda Python is available for Python 3.6 and Python 2.7. In this article, I am going to show you how to download and install Anaconda Python for Python 3.6. The process is similar for Anaconda Python for Python 2.7.

Click on the Download button to download Anaconda Python for Python 3.6.

Now click on Save File and then click on OK.

Your download should start.

Installing Anaconda Python:

Now that Anaconda Python is downloaded, you can install it on your Ubuntu 18.04 LTS computer. I am going to show you how in this section.

First open up a Terminal and navigate to the ~/Downloads/ directory in your user’s HOME directory where you downloaded Anaconda Python with the following command:

How To Install Python Packages

If you list the contents of the ~/Downloads/ directory, you should see the Anaconda Python installer as you can see in the marked section of the screenshot below.

NOTE: By default, Anaconda Python will be installed on the ~/anaconda3 or ~/anaconda2 directory in your user’s HOME directory depending on which Python version of Anaconda Python you are trying to install. If you don’t have any problem with that, you can run the Anaconda Python installer without sudo or super user privileges. But if you want to install it somewhere else such as /usr/local/anaconda3 or /usr/local/anaconda2, or /opt/anaconda3 or /opt/anaconda2, then you must run the Anaconda Python installer with sudo or super user privileges and configure the PATH of your computer manually.

Now to install Anaconda Python, run the following command:

Now press <Enter>.

Now press the <Space Bar> several times to go to the end of the License Agreement.

Once you see the following prompt, type in yes and then press <Enter> to continue.

Now you should see the following prompt. Here you put a directory path where you want Anaconda Python to be installed. By default, it is the ~/anaconda3 or ~/anaconda2 directory in your user’s HOME directory. But you can change that. I am going with the default. Just press <Enter>.

The installation should start.

Once the installation is complete, the installer should ask you whether you want to add Anaconda Python to the PATH of your Ubuntu 18.04 LTS. Type in yes and press <Enter>.

How To Install Python On Ubuntu

The installation and configuration is complete.

Recently Microsoft and Anaconda has joined up. So Anaconda Python installer asks whether you want to install the Microsoft’s free code editor Visual Studio Code. I will just say no as I don’t want to install Visual Studio Code.

Testing Anaconda Python:

Now that Anaconda Python is installed, you can open a new terminal and type in the following command to check whether Anaconda Python is added to the PATH of your Ubuntu 18.04 LTS operating system.

As you can see from the marked section of the screenshot below, the Anaconda Python is on the PATH.

To check whether Anaconda Python is working, run the following command:

As you can see, Anaconda Python is working correctly.

Installing New Packages of Anaconda Python:

Anaconda Python comes with a lot of packages pre-installed. But it you need some other packages, you can install it very easily with conda command.

You can find a list of all the packages available on Anaconda Python at https://docs.anaconda.com/anaconda/packages/pkg-docs

Click on your Anaconda Python version and operating system from the page. I installed Anaconda Python 64-bit for Python 3.6, so I clicked on the marked link 64-bit Linux, Py3.6.

You should see a table as shown in the screenshot below. The table contains 4 columns. The Name column contains the package name. The Version column holds the package version, Summary/License column holds a short description of the package and the In Installer column has marks that indicates whether the package is included in the Anaconda Python installer. If a tick mark is present, it means the package is already installed, so you don’t have to install it manually after installing Anaconda Python.

Now to install an Anaconda Python package, let’s say gitpython, run the following command:

Now press y and then press <Enter> to continue.

The gitpython package should be installed.

Removing an Anaconda Python Packages:

You can list all the installed Anaconda Python package with the following command:

To remove an Anaconda Python package, let’s say the gitpython package I just installed, run the following command:

Press y and then press <Enter> to continue.

How To Install Python3 On Ubuntu

The gitpython package should be removed.

So that’s how you install Anaconda Python and manage Anaconda Python packages. Thanks for reading this article.

This quick tutorial is going to show you how to install Python 3.3.5 (or 3.4.0) and set as default in Ubuntu 14.04 and Ubuntu 12.04.

How

Python 3.3.5 was released on March 9th, 2014. It fixed:

  • a 3.3.4 regression in zipimport
  • a 3.3.4 regression executing scripts with a coding declared and Windows newlines
  • potential DOS using compression codecs in bytes.decode()

Python 3.4.0 was released one week later than 3.3.5 with below new features:

  • a “pathlib” module providing object-oriented filesystem paths
  • a standardized “enum” module
  • a build enhancement that will help generate introspection information for builtins
  • improved semantics for object finalization
  • adding single-dispatch generic functions to the standard library
  • a new C API for implementing custom memory allocators
  • changing file descriptors to not be inherited by default in subprocesses
  • a new “statistics” module
  • standardizing module metadata for Python’s module import system
  • a bundled installer for the pip package manager
  • a new “tracemalloc” module for tracing Python memory allocations
  • a new hash algorithm for Python strings and binary data
  • a new and improved protocol for pickled objects
  • a new “asyncio” module, a new framework for asynchronous I/O

Install:

A third party launchpad PPA contains older and newer Python version for Ubuntu. The two Python releases are available in the PPA for Ubuntu 14.04 and Ubuntu 12.04.

To add the PPA, press Ctrl+Alt+T on keyboard to open the terminal and run:

You may read the PPA description in the output and then:

Install Python 3.3.5 via:

Or install python 3.4.0 via:

To set your installed python as default, run the below commands one by one (You may change python3.3 to python3.4 in the code):