IDE is using the wrong Python instance

I’m running Komodo IDE 11.1.1 (build 91089) on MacOS Mojave. I’ve installed Python 3.7.4 from The Mac has Python 2.7 as part of the OS and you can’t monkey around with that. Python 2.7 is in /usr/bin/python while Python 3.7 is in /Library/Frameworks/Python.framework/Versions/3.7/bin/python3. In the command shell I can run either Python or Python3.

My problem is that the Komodo IDE is using Python 2.7 as its Python instance. Under Preferences/Syntax & Spell Checker it’s showing that Pylint, Pep8, and Pyflakes are not installed which is interesting, but the important takeaway is that the preferences panel shows that the Python instance is /usr/bin/python.

How do I change the python instance that the IDE uses? Suggestions welcome.

(I did find the option to start a new interactive shell as either Python or Python3. However that doesn’t seem to affect the debugger. I am trying to debug a Python3 program.)

So many preferences! I found under Project preferences I could specify Python3 and that seems to be binding to the right Python instance (/usr/local/bin/python3). However, a simple Hello World program is blowing up with “unknown locale: UTF-8” which seems to be coming from a Komodo IDE file called py3_dbgp.

So let me rephrase my original help request. Assuming that I am now invoking Python3 correctly - Does Komodo 11.1.1 work with Python 3.7?

@mbeizer, we had to fix an issue in Komodo 11.1.1 having to do with Python3.7 which should be in the latest nightly. Give it a try and report back. If the issue remains we’ll dig in. I’m not aware of any unresolved issues with Komodo and Python3.7:

  • Carey

The unknown locale: UTF-8 message went away (under 11.1.1) after I added environment variables for LANG and LC_ALL with values of en_US.UTF-8 (saw this on a post elsewhere).

After installing 11.1.2 I got a Debugger Error that “No Python3 interpreter is available”. However, I was able to set the path to my Python3 directory and that seems to work. Out of curiosity, I removed the environment variables from the project and that resulted in the “unknown locale” error again.

My current status is that I am able to run a program to print “Hello World” and the Python version number (3.7) so I’m in business for the moment. Support for 3.7 seems fragile but I’ll see what happens next.

Could you share the information/post you found regarding the UTF8 issue? No need for both of us to Google it :stuck_out_tongue:

  • Carey

Updating my bash_profile as suggested didn’t work for me (and I didn’t take the time to figure out why) but adding the values to the Komodo project as local environment variables worked just fine.

This would only work if you start Komodo from the terminal that loaded your bash_profile, it has no effect on Applications started from Finder.

Thanks for the post. It looks like this is a Python issue and not specific to Komodo. I’d say your workaround is the best course of action until Python or OSX resolves the issue.

I’ve definitely been no help here, but I’m glad you’re able to continue working now!

  • Carey

Thanks for the explanation about the bash_profile. It’s good to know that someone does indeed monitor and respond to these postings so you shouldn’t be too hard on yourself.

On the bright side, there’s now a new entry in the “How To” section that may be of use to someone else.


1 Like