These are chat archives for spyder-ide/public

30th
Aug 2018
CAM Gerlach
@CAM-Gerlach
Aug 30 2018 02:08

when locale settings were set to German instead of English (there a comma would actually be correct).

Indeed, you are probably on to something here, since @ccordoba12 mentioned environment variables (which could also include user locale settings C or Python is reading on startup or in operation) which is affecting the float -> string (and thus string -> float) conversion somewhere within there—in particular, perhaps something within that function or the stuff it calls is locale-sensitive (and isn't supposed to be); the reason you can't directly step into it is because its C code (as near as I can tell, its this function. You could try comparing your environment variables, locale settings etc. between the inside and outside Spyder environments, and try directly calling that function if you can figure out what to feed it and see what it outputs in both cases.

As a 'Murican I'm not that familiar with i18n issues like that , but maybe Carlos would know more.

hofingermarkus
@hofingermarkus
Aug 30 2018 09:03

I got one step further:
According to SO you can check the locale settings like this:

import locale
locale.localeconv()["decimal_point"]

which gives "," in spyder but "." in all the other consoles.

Though I'm using spyder in the english version and I did try with both - german and english keyboard settings (I did change the ubuntu keyboard settings before I started the shell in which I started sypder...) it always produced the error...

CAM Gerlach
@CAM-Gerlach
Aug 30 2018 09:13
You can't just use locale.setlocale(locale.LC_ALL, locale="en-US.UTF-8") to set it and see if it fixes it?
hofingermarkus
@hofingermarkus
Aug 30 2018 09:22
Interstingly when I called locale.getlocale() it said ('en_US', 'UTF-8')
However, I did try it, had to use locale.setlocale(locale.LC_ALL, locale="en_US.UTF-8"), and it worked....
CAM Gerlach
@CAM-Gerlach
Aug 30 2018 09:24
The settings for locale.LC_NUMERIC must have been different than the overall locale, or something was messed up then...
hofingermarkus
@hofingermarkus
Aug 30 2018 09:36

Hmm... locale.LC_NUMERIC was always equals to 1 (before and after changing the settings)
Anyway, I guess It would probably make sense to report the issue to the tensorflow guys, so that they know that their current code only works with english localizations.

However, I still wonder why my localization differs in Spyder compared to the rest of the system... Any idea on that...?

CAM Gerlach
@CAM-Gerlach
Aug 30 2018 09:37
As @ccordoba12 mentioned before, probably has to do with environment variables and the specifics of Spyder's initialization vs. your other consoles. He'd know more about the specifics there.
hofingermarkus
@hofingermarkus
Aug 30 2018 09:41
Ok, thank you for your help so far! Was really helpful! :)
CAM Gerlach
@CAM-Gerlach
Aug 30 2018 09:42
Glad to help!
hofingermarkus
@hofingermarkus
Aug 30 2018 09:43
@ccordoba12
Do you have any idea what could cause that my spyders locale setting is different from that of the rest of the system, and how I could permanently change that?
Carlos Cordoba
@ccordoba12
Aug 30 2018 10:50
@hofingermarkus, are you starting Spyder from a terminal (xterm, konsole, etc) or graphically?
Royalekawasaki
@Royalekawasaki
Aug 30 2018 11:43
Hai , can anyone help me with the installation od sypder
hofingermarkus
@hofingermarkus
Aug 30 2018 12:27
@ccordoba12 I am starting it from a standard ubuntu 16.04 terminal, after firing up the appropriate anaconda environment...
CAM Gerlach
@CAM-Gerlach
Aug 30 2018 16:16

Hai , can anyone help me with the installation od sypder

Did you try reading the docs?