How to solve "Error: /bin/sh: py: command not found"? - komodo

I have just installed Komodo on Mac and attempted to create a Run Command (Ctrl + Shift + R). It seems that I followed the instructions and did everything correct but once I use the command to run a code, the error occurred:
Error /bin/sh: py: command not found appears.
Can anyone please help me with this?
Thank you very much in advance!

It doesn't recognize the "py" command. Install python for mac: Python Releases for Mac.
After that you type in the terminal "python --version" and there should be a output like this: "Python X.X.X.X".
If this doesn't works, try to uninstall all previous versions.

I'm starting to learn Python via Komodo too.
I'm using a Mac and had the same issue. I replaced "py" with "python3" in the command line and it worked for me.
ps: I'm currently on python 3.7.3

Related

How can I solve /bin/sh: python: command not found on Mac?

I already installed VS CODE on my Mac and did all the settings. I put codes in it, and it responded, "/bin/sh: python: command not found."
I tried all kinds of methods, but they didn't seem to help.
Here is a screenshot of the error.
Please help me.
Probably the path of the python interpreter is misconfigured.
You can open a terminal and write the following command: $ whereis python
If this command does not return anything, it is likely that python is not installed (or undefined in the var env 'path') on your Mac.
If you have a path to an interpreter, change the interpreter path used by vscode.
Go to the settings and edit the field : "python : interpreter path" with the right one.
Good day.

Why a MAC OS X 'terminal command' run by a Python script gives error output "command not found"?

Environment:
Python 3.8
Mac OS X High Sierra 10.13.6
Problem:
When I open my terminal in my macbook and I run this command:
user$sdk version
I get no issue and I can see version number of sdkman:
SDKMAN 5.9.0+555
But if I try to do the same from my Python 3.8 script, I get an error output:
command_sdkman_version_0='sdk version'
os.system(command_sdkman_version_0)
sh: sdk: command not found
When I print the PATH environment variable from terminal and from the script, they are both the same.
When I use 'sudo sdk version', I have same issue.
What is wrong?
I had the same issue but using a shell script.
For me the fix was that when running the script instead of using
./scriptName.sh
i had to use
. ./scriptName.sh
For a more detailed explication please see the fallowing post:
How to execute bash script in same shell

I can't submit my CS50 code solution using terminal on mac

So I am trying to submit my CS50 (https://cs50.harvard.edu/x/2020/tracks/mobile/android/fiftygram/) in my terminal by using submit50 cs50/problems/2020/x/tracks/android/fiftygram. I have installed pip3 and CS50 but I keep getting an error zsh:
command not found: submit50
Please help! How do I solve this?
You also need to install submit50 itself. The instructions are here:
https://cs50.readthedocs.io/submit50/#installation
Edit: given the comment that OP has done this, try updating pip. It may be a version issue after switching to zsh. Alternatively, if you still have another shell use that.
https://unix.stackexchange.com/questions/557185/pip-error-after-changing-from-bash-to-zsh

How can I get pylint to use python 3 in VS code?

I want pylint to use python3 for linting in Visual Studio code on Mac (which has both python 2.7 standard and python 3.6).
I've tried changing the path to the python interpreter as per How can I debug Python3 code in Visual Studio Code, to no avail. I keep getting python2 errors instead of python3 errors.
See example code for the problem.
Is there a way I can get pylint to recognize python3 errors?
Pick a xx.py in Visual Studio Coce(VSC)
In Status Bar Tap Python 2.7.10 like the [img1]
Choose python 3.x like [img2]
Command+Q quit VSC, then open VSC again
I finally got it working by installing python3 pylint from the console.
sudo python3 -m pip install -U pylint
The simple solution is to just change the first line of the file /home/user_name/.local/bin/pylint from #!/usr/bin/python2 to #!/usr/bin/python3
If you want more, you can rename this file to pylint2 and have a copy pylint3 where you change the first line to #!/usr/bin/python3.
Now to use pylint3 from command line you just need to type pylint3 instead of pylint.. also change the directory of pylinter in vscode to /home/user_name/.local/bin/pylint3
explanation
Ok this might be very late and the answer might not be the optimum, but I had the same issue.
By default the path to pylint is /home/user_name/.local/bin/pylint that is a simple python script working as the entry point to pylint.. even after installing pylint using pip3 this file is not changed and keeps directing to use python2 and therefore the packages installed by pip2 for python2.
So either have separate entry points for each pylint version, or modify this one manually to use the pylint package installed for python3.

Error in using 'theano-nose' command

After installing Theano from Enthought Canopy on Windows, following the steps here: http://deeplearning.net/software/theano/install.html#id9 , I tried to execute the command theano-nose from Canopy terminal. I got an error message saying "unable to find theano-nose". Can someone tell me what might be going wrong?
theano-nose is from the command line. But your shell need to be able to find it.
It is highly possible it didn't got installed correctly on Windows or that you need to reboot or log out/log in. I do not remember Windows particularities on that level.
But a simple work around is to start python and run this:
import theano
theano.test()
This is equivalent for what you want to do.

Resources