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. 就一臺服務器,mysql數據庫想實現自動備份,如何設計?2. mysql - thinkphp5 在MAC電腦本地正常,部署LINUX服務器之后,模型不存在3. 編輯管理員信息時,為什么沒有修改過的內容會為空?4. 求救一下,用新版的phpstudy,數據庫過段時間會消失是什么情況?5. javascript - 百度圖片切換圖片時url會改變,但無刷新,沒用hash,IE8也支持,請問是用了什么技術?6. 這是什么情況???7. node.js - win10如何安裝并使用babel?8. python - xpath中如何使用變量9. APP上傳到電腦服務器,出現數據上傳不完整的問題10. mysql服務無法啟動1067錯誤,誰知道正確的解決方法?
