2

I am currently using Mac OS Mojave version 10.14.2 I just installed python3.7 and uninstalled python3.6. Then, the following result occurs

$ python3
-bash: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3: No such file or directory
$ which python3
-bash: type: python3: not found
$ which python3.7
python3.7 is /usr/local/bin/python3.7

I want to make the python3 command runs python3.7 but I am very confused of the setting of python. I searched on Google but I couldn't solve it. Could you please help me? Thank you

2
  • perhaps not the ideal solution but an easy work around is creating an alias in your bashrc. alias python3='python3.7' Commented Jan 21, 2019 at 22:50
  • It is not a good idea to replace the system installed Python interpreter as some OS functions depend on that specific release. It is better to keep both versions. Commented Jan 21, 2019 at 22:51

1 Answer 1

3

That's a bad soft link since you removed python3.

Check out where python3 is by

which python3

Then use the return of that output to see what it's currently pointing to

ls -la $(which python3)

Replace the bad python3 softlink with the correct python3.7

ln -sf $(which python3.7) /usr/local/bin/python3

Test out the version

python3 --version

In the future, check out pyenv because it will make installing new versions of python and switching between versions much easier.

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

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.