2

My python console won't work at all. I can't open it. My QGIS version is 2.4. OS is win7 64. I've reinstalled QGIS a few times but I always get the same result. Strange. Something went wrong with the source code I guess? Here's the error :

Traceback (most recent call last):   File "", line 2, in    File "C:/OSGEO4~1/apps/qgis/./python\console\console.py", line 43, in
 show_console
     _console = PythonConsole( parent )   File "C:/OSGEO4~1/apps/qgis/./python\console\console.py", line 75, in
 __init__
     self.console = PythonConsoleWidget(self)   File "C:/OSGEO4~1/apps/qgis/./python\console\console.py", line 101, in
 __init__
     self.shellOut = ShellOutputScintilla(self)   File "C:/OSGEO4~1/apps/qgis/./python\console\console_output.py", line 103,
 in __init__
     self.insertInitText()   File "C:/OSGEO4~1/apps/qgis/./python\console\console_output.py", line 145,
 in insertInitText
     socket.gethostname()) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 9: ordinal not in range(128) Version de
 Python :
 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] Version de QGIS :
 2.4.0-Chugiak 'Chugiak', 8fdd08a Chemin vers Python : ['C:/OSGEO4~1/apps/qgis/./python/plugins\\processing',
1
  • 2
    socket.gethostname() returns the name you (or your administrator) have given your computer. This must be english letters. Try to change your computers name to only include english letters.
    – Jakob
    Aug 19, 2014 at 13:27

1 Answer 1

1

socket.gethostname() returns the name you (or your administrator) have given your computer. This must be english letters (ASCII). Try to change your computers name to only include english letters.

2
  • Thank's a lot Jakob. You saved my day! It works perfectly now. I was wondering how it worked with other languages (chinese, arabic,..). Can it not be set to python to use UTF8?
    – Msieurico
    Aug 21, 2014 at 4:39
  • Not sure it is possibly in Python 2.7 with socket.gethostname(). I used to be a C# developer enjoying danish letters, now working with Python 2.7 half of my time goes with sorting stuff like this out. May not, myself, have seen the light yet...
    – Jakob
    Aug 21, 2014 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.