Since matplotlib is provided only up to Python2 in the standard package of Ubuntu 12, I was looking for how to use the latest Python3.5 (as of July 4, 2016) [Anaconda](https: //) I found something called www.continuum.io/).
Anaconda not only supports Windows, OS X, and Linux platforms, but also supports Python 2.7 and 3.5, 32bit and 64bit, which is quite substantial. If that's true, I'm pretty happy, so I tried it.
Anaconda seems to be all-in-one and contains a considerable amount of libraries, and requires at least 329M of disk space for the installer alone and 1.3G after installation. We recommend that you check the free space before installing.
$ du -hs Anaconda3-4.1.0-Linux-x86.sh
329M Anaconda3-4.1.0-Linux-x86.sh
$ du -hs anaconda3
1.3G anaconda3
Go to Anaconda Official Website and download the installer. This time, I downloaded the Linux (32bit) version of Python3.5 (Anaconda3-4.1.0-Linux-x86.sh). Run the downloaded file to install it.
$ bash Anaconda3-4.1.0-Linux-x86.sh
Welcome to Anaconda3 4.1.0 (by Continuum Analytics, Inc.)
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
Just press the [Enter] key.
================
Anaconda License
================
Copyright 2016, Continuum Analytics, Inc.
All rights reserved under the 3-clause BSD License:
(abridgement)
Do you approve the license terms? [yes|no]
>>>
Anaconda Reisen will be displayed. If you like, enter yes and press [Enter].
Anaconda3 will now be installed into this location:
/home/hachi/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/hachi/anaconda3] >>>
Perhaps can I install it in the home directory of the currently logged in user (/ home / hachi / anaconda3 in this case)? I think you've heard that, so just press [Enter].
PREFIX=/home/hachi/anaconda3
installing: python-3.5.1-5 ...
(abridgement)
Python 3.5.1 :: Continuum Analytics, Inc.
creating default environment...
installation finished.
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/hachi/.bashrc ? [yes|no]
[no] >>>
Can I add the Anaconda3 path after the installation is complete after a while? (Maybe), but if you add it, it will be a problem elsewhere, so enter "no" this time and press [Enter].
You may wish to edit your .bashrc or prepend the Anaconda3 install location:
$ export PATH=/home/hachi/anaconda3/bin:$PATH
Thank you for installing Anaconda3!
Share your notebooks and packages on Anaconda Cloud!
Sign up for free: https://anaconda.org
The installation is complete, so check the version. In the case of Ubuntu 12, the python
command was version 2.X and the python3
command was version 3.X, but in the case of Anaconda, both python
and python3
seem to be version 3, so be careful. May be needed.
$ anaconda3/bin/python --version
Python 3.5.1 :: Anaconda 4.1.0 (32-bit)
$ anaconda3/bin/python3 --version
Python 3.5.1 :: Anaconda 4.1.0 (32-bit)
It seems that the Python version is a little old, so use the conda
command to upgrade it.
$ anaconda3/bin/conda upgrade -y --all
Fetching package metadata .......
Solving package specifications: ..........
(abridgement)
Extracting packages ...
[ COMPLETE ]|###################################################| 100%
Unlinking packages ...
[ COMPLETE ]|###################################################| 100%
Linking packages ...
[ COMPLETE ]|###################################################| 100%
Check the version again.
$ anaconda3/bin/python --version
Python 3.5.2 :: Anaconda custom (32-bit)
It seems that the latest Python could be installed on Ubuntu 12.
Since it seems that it has been installed, try date_demo.py published on matploblib. I will try it.
$ anaconda3/bin/python date_demo.py
/home/hachi/anaconda3/lib/python3.5/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
The first time you will be prompted to create a font cache, wait a minute.
It was displayed!
Although the capacity is large, I think that the environment could be built with almost no effort. Even if the Python version is slightly different depending on the OS and compatibility is a concern, using Anaconda seems to be able to unify all with the same version. Not only can you quickly build an environment for drawing graphs, but you can also use it for the purpose of unifying the environment.
Recommended Posts