In the past, I was able to open my Python console without any problems on QGIS. However, just recently, I tried to open the Python console on QGIS 2.18.2 (Las Palmas) on my mac, but I get this error message:

Traceback (most recent call last):
  File "", line 2, in 
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/console/console.py", line 46, in show_console
    _console = PythonConsole(parent)
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/console/console.py", line 83, in __init__
    self.console = PythonConsoleWidget(self)
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/console/console.py", line 109, in __init__
    self.shell = ShellScintilla(self)
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/console/console_sci.py", line 86, in __init__
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/console/console_sci.py", line 141, in refreshSettingsShell
TypeError: QsciScintilla.setCaretForegroundColor(QColor): argument 1 has unexpected type 'unicode'

I have no idea what any of this means. I originally downloaded QGIS from kyngchaos.com, and redownloaded from the same source to see if it would work, but it didn't.

  • I had a similar problem with the python console and deleted the preference file. Indeed, one loses all GUI customisations, including de-activating all installed plugins which I was not expecting. However, this continues to happen every time I close and open QGIS, even if I don't delete the preference file anymore. Basically, after deleting it one time, QGIS continues to start from scratch every time. I use QGIS 2.18.15 on macOS Sierra. Commented Nov 7, 2018 at 8:25
  • Hello Codrina, welcome to GIS.SE. As annoying as your problem is, please consider asking a new question and refer to this question instead of posting a comment as an answer. Thank you.
    – Erik
    Commented Nov 7, 2018 at 9:52
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review
    – J.R
    Commented Nov 7, 2018 at 15:03
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review Commented Nov 7, 2018 at 15:12

1 Answer 1


I had the same problem here and I found a work around on this similar issue QGIS python error

you just need to remove the file containing your preferences at:


As pointed on the answer, QGIS recreates the file on the next launch. It worked perfectly here, it's not a solution to the bug but allow you to get back the console working. The problem is you will lose all of your GUI customizations, but the rest remains unchanged.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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