Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在虚拟环境python 2.7中安装matplotlib时出错_Matplotlib_Pip_Virtualenv - Fatal编程技术网

在虚拟环境python 2.7中安装matplotlib时出错

在虚拟环境python 2.7中安装matplotlib时出错,matplotlib,pip,virtualenv,Matplotlib,Pip,Virtualenv,我一直在尝试使用pip在虚拟环境中安装matplotlib 在虚拟环境中工作后,我尝试: $pip install matplotlib 但我得到了一个错误: unable to execute 'c++' : No such file or directory error : command 'c++' failed with exit status 1 ------------------------------------------ Cleaning up 我使用的是Ubuntu14

我一直在尝试使用pip在虚拟环境中安装matplotlib

在虚拟环境中工作后,我尝试:

$pip install matplotlib
但我得到了一个错误:

unable to execute 'c++' : No such file or directory
error : command 'c++' failed with exit status 1
------------------------------------------
Cleaning up
我使用的是Ubuntu14.04,matplotlib在不使用virtualenv的情况下对我来说效果很好,但我希望它在virtualenv中用于我拥有的单独项目


有什么建议吗

通过升级pip解决了这个问题,似乎在创建virtualenv时安装了1.5.4版

$ pip install --upgrade pip 
然后使用pip安装matplotlib

$pip install matplotlib

您是否尝试使用apt get安装gcc?是的,这就是为什么我的全球网站包中有它,我只是无法在virtualenv中安装它