0

So I have tried to install python when my terminal showed that I didn't have python, which was weird because I thought I did. When I tried to find it I couldn't find it, I used commands like:

which python

When I tried to remove python (I was trying random things):

sudo apt remove python

Then this error would show: The operation couldn’t be completed. Unable to locate a Java Runtime. Please visit http://www.java.com for information on installing Java.

When I tried installing it with

apt install python

It would then throw the same Java error.

UPDATE: Apologies, I am on macOS Monterrey! 12.4

andreaq
  • 17
  • 5

1 Answers1

0

The python is by default install in linux you can check with which python3 or which python2.

Uninstalling python from your device is not a good idea, Your OS is depends on python, If you uninstall default python from your device then your system will be corrupted, Your terminal , Firefox and etc system software are using resources from default python.

If your JRE is not configure then you can configure with https://ubuntu.com/tutorials/install-jre#2-installing-openjdk-jre officials.


If you need to run multiple python versions on your device then must go with pyenv it's safe and easy.

https://github.com/pyenv/pyenv/wiki

https://github.com/pyenv/pyenv

Hack-Z
  • 47
  • 7
  • Yeah honestly I am not sure when or how I might've deleted python from my Mac, but when I do the which python3 statement it now shows this: `/Library/Frameworks/Python.framework/Versions/3.10/bin/python3` I guess better than python not being found like yesterday? – andreaq Jun 10 '22 at 17:08
  • there are different versions in python, python2 and python3. when you do `which python` then it's looking for python2 by default. – Hack-Z Jun 13 '22 at 05:14