工作中,需要在ubuntu下测试c++代码, 想找一个简单的数据可视化工具。想到python上经常使用的matplotlib。根据github上的安装命令进行安装

在终端输入命令:
sudo apt-get install python-matplotlib python-numpy
居然报错了。
sudo apt-get install python-matplotlib
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-matplotlib is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-matplotlib' has no installation candidate
尝试了好多方法,
大部分说是 更新一下 源 列表什么的, 就是:sudo apt-get -y update 。但是对这个没有效果。
最后参考 这边博文:unable to locate package libavcodec-dev 解决办法_unable to locate package libva-dev_卜令彬的博客-优快云博客
搜索了一下 matplotlib

发现在这个包在python3 下的名字为python3-matplotlib。 根据这个名称进行安装得以顺利进行。
在Ubuntu系统中尝试使用apt-get安装python-matplotlib时遇到错误,提示没有安装候选。更新源列表无效后,通过在packages.ubuntu.com网站搜索发现,matplotlib的Python3版本名为python3-matplotlib。按照这个名字安装成功解决了问题。
2万+






