1

I have no idea on how to solve this, I've tried to

echo "alias python=/usr/bin/python3" >> ~/.zshrc

And also

brew install python

I'm new on this so I really don't know what I'm doing, if someone could explain why I'm supposed to write those lines on my terminal I'd be very grateful

1
  • Have you tried to install the python from the official docs? Commented Apr 29, 2022 at 6:50

3 Answers 3

2

Try this: python3 file_name.py runserver

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
1

Try python3 --version in your terminal window, if it returned the version details, then python is installed in your system.

1 Comment

Okay, then what to do next? I am also getting the same error while trying to run a .py file on my vscode ; $zsh: command not found: python$
1

after updating to macos Monterey 12.6.1 had similar problem.
Before this update, python referred to python2.7 which was removed completely in the latest Monterey versions.
Using following fix:

sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Applications/Xcode.app/Contents/Developer/usr/bin/python
sudo ln -s /usr/bin/python3 /usr/local/bin/python

Result:

python -V
Python 3.9.6

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.