在mac os x上导入matplotlib时出错

时间:2016-10-19 01:28:08

标签: python matplotlib

>>> import matplotlib.pyplot as plt
objc[19151]: Class TKApplication is implemented in both /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (0x107aab188) and /Users/rit/anaconda2/envs/mac_gdal/lib/libtk8.5.dylib (0x1117e0e40). One of the two will be used. Which one is undefined.
objc[19151]: Class TKMenu is implemented in both /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (0x107aab1d8) and /Users/rit/anaconda2/envs/mac_gdal/lib/libtk8.5.dylib (0x1117e2020). One of the two will be used. Which one is undefined.
objc[19151]: Class TKContentView is implemented in both /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (0x107aab228) and /Users/rit/anaconda2/envs/mac_gdal/lib/libtk8.5.dylib (0x1117e28a0). One of the two will be used. Which one is undefined.
objc[19151]: Class TKWindow is implemented in both /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (0x107aab278) and /Users/rit/anaconda2/envs/mac_gdal/lib/libtk8.5.dylib (0x1117e2da0). One of the two will be used. Which one is undefined.

导入matplotlib时如何修复此错误。我在Mac Os X(Sierra)上使用python 2.7.12

1 个答案:

答案 0 :(得分:0)

正如评论中所述,Python无法决定使用哪个tk版本。你的计划是否使用anaconda环境?如果您没有理由使用anaconda版本,我只需将其删除并使用系统版本。

rm /Users/rit/anaconda2/envs/mac_gdal/lib/libtk8.5.dylib