1

I have install python 3.6.5 (With brew) and when I execute python command in a shell, it is always python 2.7 that come.

I have executed these command see in an other post but nothing work:

Remove the third-party Python 2.7 framework

sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7

Remove the Python 2.7 applications directory

sudo rm -rf "/Applications/Python 2.7"

Remove the symbolic links in /usr/local/bin that point to this Python version see ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' and then run the following command to remove all the links:

cd /usr/local/bin/
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm
Tryliom
  • 111
  • 1
  • 17

1 Answers1

0

There's always a system Python 2.7 in macOS (/usr/bin/python), which you can't really remove.

Use python3 if you want to run Python 3.

See PEP 0394 for details about the nomenclature.

AKX
  • 152,115
  • 15
  • 115
  • 172