New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: import fails (MacOS X 10.10.1, Python 3.4.2, matplotlib ca10a34e06645c35a98e9ed3db35f6a8efee70f2 ) #3870
Comments
It looks like
|
Yes
|
That said, I think it is fair to assume that core library functions are working correctly. Unless we are using |
Fair enough. There definitely seems to be a |
I am going to close this for now, please ping to have this re-opened if we are doing something wrong and it is not a configuration issue on your end. |
In light of our exchange, it is clear that what I see is not a matplolib bug (so I guess this issue should not be re-opened). However, it appears passing environment variables has become quite problematic under MacOS X 10.10 (this is what I glean from trying to find answers on the net; the following gives an idea of the scope of the problem: http://stackoverflow.com/questions/25385934/setting-environment-variables-via-launchd-conf-no-longer-works-in-os-x-yosemite). At any rate, even though Could it be possible then to implement a workaround, i.e. if the locale is not fount (or is |
Am I reading that SO question right that Apple decided to break the OS? It looks like you are using the system python? Does this problem exist if you use one of the other python distributions (anaconda, canopy, homebrew)? Reading a bit more of the commit that added this change the issue it was closing is #1713 which is a rather major feature. I don't fully understand the exception you are getting as my system happily returns 'UTF-8' as the encoding part of the locale:
Can you please tell us what envs you think are set? It is really hard to sort out what is going on here if no one else can reproduce it. |
Sorry for the rambling bellow and the inconvenience, but typing it led me to find the problem! The env which was the root of the difficulties was Now on to the next problem (later!)… ==== text below superseded by the above ==== I have the same reading of that SO question… I am not using the system python. I use a compiled-from-(unmodified)-sources python, framework build. I have the following env:
and replicating your code I get the following:
(same with variants: To add to the confusion, within IDLE I get the following:
hence, it is not possible to debug that way. Explicitly setting the locale before importing matplotlib fails as well:
Is it possible that I may have overlooked a language setting in matplotlibrc? I looked but did not find one. |
I had a similar problem, and found the solution here: In MacOS Terminal Preferences | Settings | Advanced: uncheck the button "set environment variables on startup". |
Thanks for the reminder (I just got bitten again on a new machine)! For completeness, under MacOS X 10.11 ("El Capitan"), the setting is now in Terminal Preferences | Profiles | Advanced. |
Yeah -- Apple is not following what POSIX says about what LANG should be here. Either Python needs to update to support that non-standard value, or Apple needs to follow the standard. |
I have the same problem. But it still exists even I do what you said(uncheck the button "set environment variables on startup") Could you please help me to fix this? |
You have to restart the terminal after having unchecked that button: this setting is not taken into account until the next session. As well, once this is done and you want to also print some unicode in the terminal, you should use the following in your script before the first
|
As an addendum, the above method has (at least) one drawback: it is no longer possible to input the whole range of unicode character at the Terminal's prompt. It thus appears preferable to do the following:
At least you will be able to input unicode characters in the terminal (even though in this exemple, |
Using MacOS X 10.10.1, Python 3.4.2, matplotlib ca10a34 and the simple input "import matplotlib" results in failure with the following message:
The import works without problem, however, using MacOS X 10.10.1, Python 3.4.2, matplotlib-1.4.2 .
Hubert Holin
The text was updated successfully, but these errors were encountered: