Gtk warning after ugrading to yosemite

∥☆過路亽.° 提交于 2019-12-08 03:43:11

问题


I am trying to run a program written in python on my mac (Yosemite). Almost immediately after starting the program it gives me the following error:

Gtk-WARNING **: Locale not supported by C library.
    Using the fallback 'C' locale.

[edit] tried to isolate the issue, the error appears upon entering

Adriaan$ ipython --gui=gtk
Python 2.7.8 (default, Nov  5 2014, 15:41:54) 
Type "copyright", "credits" or "license" for more information.

IPython 2.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

(process:969): Gtk-WARNING **: Locale not supported by C library.
    Using the fallback 'C' locale.

I have tried reinstalling X11(v2.7.7) and rebooting. (as listed in similar threads). Does anyone know how to resolve this error?


回答1:


Try to run Xquartz.app first. Then:

import matplotlib

matplotlib.use('TkAgg')

from matplotlib import pyplot 

Generally works for me after each OS upgrade.



来源:https://stackoverflow.com/questions/26840889/gtk-warning-after-ugrading-to-yosemite

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!