Error while trying to run a python-3 script in komodo 8.5

hi i have isntalled python 3.4.1 in my pc with the system path variables, and have komodo 8.5 (i think this is the latest version of komdo)

in komodo i go to edit-> preferences -> python 3 and put the python.exe path in the “use interpreter” option i left in blank “additional Python 3 Import Directories”.

then i created a python3 file that looked like this

#!/usr/bin/env python3

print(“hello world”)

when i press F5 or F7 a debugging menu window opens with some options.

Configuration: default
Language: Python3
Interpreter Arguments: empty
Script: My Script Path
Script Arguments: empty
Directory: i try to put mi script direcoty or i try to left it in blank but neither option works

then i hit the Ok button and this error message shows up

Traceback (most recent call last):
  File “C:\Program Files\ActiveState Komodo IDE 8\lib\support\dbgp\bin\py3_dbgp.py”, line 305, in
    sys.exit( main(sys.argv) )
  File “C:\Program Files\ActiveState Komodo IDE 8\lib\support\dbgp\bin\py3_dbgp.py”, line 234, in main
    if optarg in logging._levelNames:
AttributeError: ‘module’ object has no attribute ‘_levelNames’

what do i need to do to run a python3 script with komodo

thanks in advace sry for the bad english

Just create a new “Command” in Toolbox with this text: %(python3) %f or run it. I think you don’t need to run debugger if you want to run python file.

hi thank you for your answer, but how do i run it, the only option i see if the one that says “run without debugging” but it shows me the same window menu that i described before.

i try the command that you mentioned before and it worked, thanks, but i also would like to know if theres any documentation using komodo 8 with python!!“3”!!! not regular python because the python tutorial i think that is writhing only for python 2 thanks in advance

You want to create macros/addons in Python3 language for Komodo or what? Can you rephrase?
And if you would like to run “Command” file, you just need double-click on there in Toolbox sidebar :smile:

ii just wanted to learn python 3 and i wanted to use komodo to debug my python 3 code nad make things easier, and i watned to read the komodo 8 python 3 documentation before asking in this forum but i cant find it.

i also wanted to debug my code but this error appear when i try


Traceback (most recent call last):
  File “C:\Program Files\ActiveState Komodo IDE 8\lib\support\dbgp\bin\py3_dbgp.py”, line 305, in
    sys.exit( main(sys.argv) )
  File “C:\Program Files\ActiveState Komodo IDE 8\lib\support\dbgp\bin\py3_dbgp.py”, line 234, in main
    if optarg in logging.levelNames:
AttributeError: ‘module’ object has no attribute ‘levelNames’

He is trying to run the script from the Komodo debugger, running it as a command won’t give him the desired result.

@pythonpreguntr

You seem to have miss-typed your shebang, this should be #!/usr/bin/env python3

Additionally, please make sure that the python.exe you have configured under Prefs > Python 3 is indeed a Python 3 executable and not python 2.

hi frien, when you use the option “add file” to your Directory you can select the Python3.py option this will put automatically this shebang “#!/usr/bin/env python3” to your file, and i pretty sure that i selected the python3 executable because is the only python version that i have in my pc.

this is my python3 script just to be sure

#!/usr/bin/env python3

num = 2
number2 = 4

print("hello world")

and this are my option in the debug window

Configuration: default
Language: Python3
Interpreter Arguments: empty
Script: My Script Path
Script Arguments: empty
Directory: i try to put mi script direcoty or i try to left it in blank but neither option works

and this is the error i get

Traceback (most recent call last):
  File “C:\Program Files\ActiveState Komodo IDE 8\lib\support\dbgp\bin\py3_dbgp.py”, line 305, in
    sys.exit( main(sys.argv) )
  File “C:\Program Files\ActiveState Komodo IDE 8\lib\support\dbgp\bin\py3_dbgp.py”, line 234, in main
    if optarg in logging._levelNames:
AttributeError: ‘module’ object has no attribute ‘_levelNames’

Hi! Sorry about that; Komodo 8.5.3 wasn’t quite compatible with Python 3.4. Please try a Komodo 8.5.4 nightly instead.

For reference, this was bug 103631.