'env' is not recognized as an internal or external command, operable program or batch file

I have installed Komodo, set both Python and Python 3 to UTF-8 as well as default encoding to UTF-8. I have also installed Python 3.7 and selected add Path for environment. When running scripts I am getting the following error.

‘env’ is not recognized as an internal or external command,
operable program or batch file.

I do not know what to do at this point, please help.

What are these scripts you’re running? They appear to be trying to run a command called env at some point and you don’t have it on your system PATH so it fails with that error. I don’t know what this has to do with Python. That’s all I can determine so far from the info here.

Please tell us what exactly you’re trying to do, what you expect to happen and what these scripts are. If you can’t share the script due to IP (intellectual property) rules where you’re at then give us the gist.

  • Carey

Hi Carey,

I am trying to run some basic scripts from an online learning class from LinkedIn, so nothing is proprietary. The setup was based on a Mac, so perhaps that is the issue. I used env LANG=en_US.UTF-8 "%F% for my hot key to run the script and when I do so, it errors out. Let me know if you need more information.

Hi, instead of setting your environment variable in the command, just run the command by itself "%F" or python "%F", and in the “Advanced Settings” tab set the environment variable there.

Hi Mitchell,

Forgive my ignorance, may you walk me through where exactly I should set %F or python %F? Should I create a new hotkey as well?

@Hitesh_Chauhan, regarding @mitchell’s comment, look at your second screenshot. You can set environmental variables there instead of in your command.

But there is something wrong with your Komodo configuration. env should work fine. Check Edit menu > Preferences > Environment and make sure you have a PATH variable.

To summarize, you’re trying to use our tool that runs commands on the commandline. When you ran the command it was not able to find the binary on your path. env is on your system path by default on Windows so something is wrong with your system path.

  • Carey

Is there a way to make the scripts run without setting up custom key binding commands for Python? I am not able to get this to work.

I do have a PATH Variable in the Environment section.

@Hitesh_Chauhan,

If you don’t want to use key bindings then just double click it in the toolbox.

Thanks for confirming your path isn’t being overridden in Komodos prefs. Now confirm that env exist in your terminal. Open a Windows command prompt and try to run the same command.

Re @mitchell’s comment: have you tried setting your env var in the Advanced Options tab of the tools options dialog?

-Carey

Double clicking gives me the same error. I need to setup a run command to execute my python scripts, not sure how to do so.

looks like it is not working in command prompt either… Perhaps I need more configuring?

set this too, does not work.

I think you need to contact the people that wrote the tutorial or something @Hitesh_Chauhan. That command you pasted into your Python shell is broken. It tells you why in the output: NameError: name 'platform' is not defined.

Unfortunately, this isn’t a problem with Komodo, it’s an issue with whatever guide/tutorial you’re using. I can’t help with that.

  • Carey

Will do, thanks for trying Carey!

1 Like

Best of luck to you @Hitesh_Chauhan! Don’t hesitate to come back with more questions if you have issues with Komodo.

@Hitesh_Chauhan : Try this on your windows machine & it should work. For command use %(python) %F

@pranavdamele

I received the following error message:

@Hitesh_Chauhan, it says it in the dialog, you need to configure Python in your preferences, Edit menu > Preferences > Languages > Python, in the Use this Interpreter browser to the Python interpreter.

Komodo should have picked this up for you if Python was on your system PATH.

  • Carey

Sadly its there… I completely give up…

Q1 | Open CMD prompt on your Windows machine and type python . What is the output ?
Q2 | Open CMD prompt on your Windows machine and type path . What is the output ?

@Hitesh_Chauhan, there is a subsection to that preference. See the > beside Languages? Click that THEN click Python.

@pranavdamele, those commands won’t output anything. Is that what your tutorial actually tells you to input into the commandline?

  • python just opens the Python shell. You should run python -V maybe?
  • path won’t print anything execpt something along the lines of this doesn't exist on your path. You’ll have to do echo %PATH% to get meaningful output.

Do you guys have a teacher to assist you with this stuff? The tutorial you’re following sounds like it’s missing a lot of information and is just broken in a lot of place.

  • carey

Maybe you could point me to the Tutorial so I can have a look?