Closed
Description
I have a virtual environment on a new device for Python2.7. I want to install matplotlib, but it is throwing me the following error:
(venv2.7) osm:~$ pip install matplotlib
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting matplotlib
Using cached https://files.pythonhosted.org/packages/1e/20/2032ad99f0dfe0f60970941af36e8d0942d3713f442bb3df37ac35d67358/matplotlib-2.2.4.tar.gz
ERROR: Command errored out with exit status 1:
command: /home/osm/venv2.7/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v0wvdH/matplotlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v0wvdH/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-v0wvdH/matplotlib/
Complete output (62 lines):
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [2.2.4]
python: yes [2.7.15+ (default, Nov 27 2018, 23:36:35) [GCC
7.3.0]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.16.5]
install_requires: yes [handled by setuptools]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
-----> freetype: no [The C/C++ header for freetype2 (ft2build.h)
could not be found. You may need to install the
development package.]
-----> png: no [The C/C++ header for libpng (png.h) could not
be found. You may need to install the development
package.]
qhull: yes [pkg-config information for 'libqhull' could not
be found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: no [skipping due to configuration]
toolkits_tests: no [skipping due to configuration]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt5agg: no [PySide2 not found; PyQt5 not found]
qt4agg: no [PySide not found; PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing; run-time loading from Python Tcl /
Tk]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: yes [version 9.26]
latex: no
pdftops: yes [version 0.62.0]
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype, png
* Try installing freetype with `apt-get install
* libfreetype6-dev` and pkg-config with `apt-get
* install pkg-config`
* Try installing png with `apt-get install
* libpng12-dev` and pkg-config with `apt-get install
* pkg-config`
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
However, considering the png.h
file, I know that the header file is in my path, as
(venv2.7) osm:~$ echo $CPATH
/home/osm/.local/include:
(venv2.7) osm:~$ echo $C_INCLUDE_PATH
/home/osm/.local/include:
and
(venv2.7) osm:~$ tree /home/osm/.local/include/ -L 1
/home/osm/.local/include/
├── freetype2
├── gsl
├── libpng16
├── ncurses
├── pngconf.h -> libpng16/pngconf.h
├── png.h -> libpng16/png.h
└── pnglibconf.h -> libpng16/pnglibconf.h
I have just done local installs from source for both freetype and png and so I have no idea why it can't find the headers for these.
I know this problem is similar to
#12169