【发布时间】:2018-02-09 06:41:21
【问题描述】:
我正在尝试编写一个需要matplotlib.pyplot 的blender 脚本。尝试import matplotlib.pyplot as plt 时出现以下错误:
ImportError: No module named 'tkinter'
但是,使用安装的anaconda版本,导入是没有问题的。常用solution运行
sudo apt-get install python3-tk
不能解决问题。
我尝试将路径添加到tkinter:
sys.path.append('/usr/lib/python3.4/tkinter/')
sys.path.append('/home/<username>/anaconda3/lib/python3.6/tkinter/')
这两个命令都没有解决错误。
【问题讨论】:
-
您是否尝试使用 pip 安装 tkinter:“pip install tkinter”
-
我不知道这是可能的。使用
tkinter或python3-tk都会导致Could not find a version that satisfies the requirement tkinter (from versions: ) No matching distribution found for tkinter -
这是 tkinter,不是 tkiter
-
对不起。只是一个错字。但是来自
pip的相同错误消息。我读到了,因为它是一个C++包,它不能通过pip安装。 -
我正在使用 anaconda 发行版,它运行良好,没有上述问题 :)