Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ubuntu 14.04, pip cannot upgrade matplotllib

When I try to upgrade my matplotlib using pip, it outputs:

Downloading/unpacking matplotlib from https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.0.tar.gz#md5=1daf7f2123d94745feac1a30b210940c   Downloading matplotlib-1.4.0.tar.gz (51.2MB): 51.2MB downloaded   Running setup.py (path:/tmp/pip_build_root/matplotlib/setup.py) egg_info for package matplotlib     ============================================================================     Edit setup.cfg to change the build options      BUILDING MATPLOTLIB                 matplotlib: yes [1.4.0]                     python: yes [2.7.6 (default, Mar 22 2014, 22:59:38)  [GCC                             4.8.2]]                   platform: yes [linux2]      REQUIRED DEPENDENCIES AND EXTENSIONS                      numpy: yes [version 1.8.2]                        six: yes [using six version 1.7.3]                   dateutil: yes [using dateutil version 2.2]                    tornado: yes [using tornado version 4.0.1]                  pyparsing: yes [using pyparsing version 2.0.2]                      pycxx: yes [Couldn't import.  Using local copy.]                     libagg: yes [pkg-config information for 'libagg' could not                             be found. Using local copy.]     Traceback (most recent call last):       File "<string>", line 17, in <module>       File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>         result = package.check()       File "setupext.py", line 940, in check         if 'No such file or directory\ngrep:' in version:     TypeError: argument of type 'NoneType' is not iterable     Complete output from command python setup.py egg_info:     ============================================================================  Edit setup.cfg to change the build options    BUILDING MATPLOTLIB              matplotlib: yes [1.4.0]                  python: yes [2.7.6 (default, Mar 22 2014, 22:59:38)  [GCC                          4.8.2]]                platform: yes [linux2]    REQUIRED DEPENDENCIES AND EXTENSIONS                   numpy: yes [version 1.8.2]                     six: yes [using six version 1.7.3]                dateutil: yes [using dateutil version 2.2]                 tornado: yes [using tornado version 4.0.1]               pyparsing: yes [using pyparsing version 2.0.2]                   pycxx: yes [Couldn't import.  Using local copy.]                  libagg: yes [pkg-config information for 'libagg' could not                          be found. Using local copy.]  Traceback (most recent call last):    File "<string>", line 17, in <module>    File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>      result = package.check()    File "setupext.py", line 940, in check      if 'No such file or directory\ngrep:' in version:  TypeError: argument of type 'NoneType' is not iterable  ---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib Storing debug log for failure in /home/username/.pip/pip.log 

In the tail of the log it says:

Exception information: Traceback (most recent call last):   File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main     status = self.run(options, args)   File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 278, in run     requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)   File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1229, in prepare_files     req_to_install.run_egg_info()   File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 325, in run_egg_info     command_desc='python setup.py egg_info')   File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 697, in call_subprocess     % (command_desc, proc.returncode, cwd)) InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib 

Why did it fail? Many thanks!

like image 747
astroboylrx Avatar asked Sep 04 '14 20:09

astroboylrx


People also ask

How do I upgrade my library using pip?

Update a package: pip install --upgrade To update installed packages to the latest version, run pip install with the --upgrade or -U option.

How do I update pip3?

Updating Pip You can update pip using pip without any hassle. When an update for pip is available, and you run a pip command, you will see a message that says, “You are using pip version xy. a, however version xy. b is available.” You can run “pip install --upgrade pip” to install and use the new version of pip.

How do I install pip update?

Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process. Voila!


2 Answers

This is a known bug that has been fixed (https://github.com/matplotlib/matplotlib/pull/3414) on master.

The bug is in the handling of searching for a freetype installation. If you install the Linux package freetype-dev, you will avoid this bug and be able to compile matplotlib.

sudo apt-get install libfreetype6-dev 
like image 168
tacaswell Avatar answered Sep 27 '22 23:09

tacaswell


On Ubuntu 14 server, you also need to install libxft-dev

sudo apt-get install libfreetype6-dev libxft-dev 
like image 41
Zeinab Mahdavifar Avatar answered Sep 28 '22 00:09

Zeinab Mahdavifar