python - matplotlib安装之后使用出错
问题描述
产生错误:
ImportError: No module named ’_tkinter’, please install the python3-tk package
在网上找到的解决方法是安装 python3-tk包:
但是在我使用的 ubuntu17.04 中找不到这个包,求解决办法?
问题解答
回答1:你把更新源换一下,然后重新试一下,换成国内阿里或者其它的。
命令行:先备份sudo /etc/apt/sources.list /etc/apt/sources.list.bak然后编辑 sudo gedit /etc/apt/sources.list把以下内容放进去替换掉原来的源
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse##测试版源deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse# 源码deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse##测试版源deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse# Canonical 合作伙伴和附加deb http://archive.canonical.com/ubuntu/ xenial partnerdeb http://extras.ubuntu.com/ubuntu/ xenial main
save保存命令行:sudo apt-get updatesudo apt-get upgradesudo apt-get install python3-tk
相关文章:
1. html5 - css3scale和rotate同时使用转换成matrix写法该如何转换?2. javascript - 修改表单多选项时和后台同事配合的问题。3. 求大神帮我看看是哪里写错了 感谢细心解答4. css - width设置为100%之后列表无法居中5. javascript - H5页面怎么查看console信息?6. javascript - 关于Js中 this的一道题7. mysql 获取时间函数unix_timestamp 问题?8. javascript - jqery ajax问题9. javascript - vue生成一维码?求助!!!!!急10. thinkjs - 使用mysql搭建cms应该如何设计表?或怎样开始?
