Wednesday, February 2, 2022

[SOLVED] Error installing matplotlib in a virtual environment python 2.7

Issue

I have been trying to install matplotlib in a virtual environment using pip.

after working on the virtual environment I tried:

$pip install matplotlib

but I get the error:

unable to execute 'c++' : No such file or directory
error : command 'c++' failed with exit status 1
------------------------------------------
Cleaning up

I am on ubuntu 14.04 and matplotlib works well for me when not using virtualenv, but I would like to have it in a virtualenv for separate projects that I have.

any suggestions?


Solution

Solved this problem by just upgrading pip, it seems there was an issue of version 1.5.4 which was installed when creating virtualenv.

$ pip install --upgrade pip 

then installed matplotlib using pip

$pip install matplotlib


Answered By - kayson
Answer Checked By - David Goodson (WPSolving Volunteer)