简体   繁体   中英

I want to make command python3 to run python3.7

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM