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. 在html文件的目錄下輸入代碼按回車后顯示這個,哪位大佬幫幫我 呀2. 老師您的微信號是多少?3. node.js - nodejs開發中常用的連接mysql的庫4. windows7 ping不通虛擬機VMware上的linux(ubuntu)的ip5. mysql - jdbc的問題6. python - 我在使用pip install -r requirements.txt下載時,為什么部分能下載,部分不能下載7. 視頻文件不能播放,怎么辦?8. mysql - 分庫分表、分區、讀寫分離 這些都是用在什么場景下 ,會帶來哪些效率或者其他方面的好處9. 網頁爬蟲 - python 爬取網站 并解析非json內容10. mysql - 如何減少使用或者不用LEFT JOIN查詢?
