Install python with brew, just run $ brew cleanup $ rm /usr/local/bin/pip3.x //if which pip3 shows To remove run, $ sudo rm -rf /Library/Python/3.x/site-packages/pip/3.x The output will look like $ pip 21.0.1 from /Library/Python/3.x/site-packages/pip (python 3.x) To find the installed place of pip3 just run $ pip3 -version If you still face permission issue just move forward Remove pip3: If it shows the error “Operation not permitted”, try to follow the instructions open this link To remove the right python version just run, In our case, we need to remove /usr/bin/python3 $ sudo rm /usr/bin/python3 /System/Library/Frameworks/amework/Versions/2.7/bin/pythonw2.7 Lrwxr-xr-x 1 root wheel 76 /usr/bin/pythonw2.7 ->. Lrwxr-xr-x 1 root wheel 76 /usr/bin/pythonw ->. rwxr-xr-x 1 root wheel 137552 /usr/bin/python3 /System/Library/Frameworks/amework/Versions/2.7/bin/python2.7-config Lrwxr-xr-x 1 root wheel 82 /usr/bin/python2.7-config ->. /System/Library/Frameworks/amework/Versions/2.7/bin/python2.7 Lrwxr-xr-x 1 root wheel 75 /usr/bin/python2.7 ->. Lrwxr-xr-x 1 root wheel 75 /usr/bin/python2 ->. Lrwxr-xr-x 1 root wheel 82 /usr/bin/python-config ->. lrwxr-xr-x 1 root wheel 75 /usr/bin/python ->. It will show you all lists of python versions installed in the bin (binaries) directory. Remove python3 without Homebrew:įist list the all python versions in shell, just run $ ls -l /usr/bin/python* If it spits out an error like Error: No available formula or cask with the name " ". Remove python3 with Homebrew: brew remove python3.x I used an example for python3.7 just replace x with your current version. Use the brew command to uninstall the python. You can read more about Homebrew over the internet Uninstall python 3: Homebrew is open-source software package management, this discussion our main objective is not what is Homebrew. $ more homebrew_installer.sh # review the script until you feel comfortable $ curl -fsSL -output homebrew_installer.sh The second option is curl to install, if you are more careful just download the install.sh, file, and install manually. Install Homebrew in Mac (Catalina, BigSur):įirst, you need to install Homebrew on your Mac. If you are interested to remove existing or install python version via Homebrew 2. Run the following command to set the global version of python and verify the version $ pyenv global 3.9 Now run command to install required python versions, In our case, we are updating to python3.9 $ pyenv install 3.9 The output will look like Available versions: You can verify the installation and list the available python versions to install $ pyenv install -list Just close the terminal and upon and execute the shell command $ exec "$SHELL" $ echo 'eval "$(pyenv init -)"' > ~/.bash_profile $ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' > ~/.bash_profile With using zsh, I successfully updated the python version to 3.9įirst, install the pyenv, just run $ brew updateĪnother option just to clone the repository of pyenv $ git clone ~/.pyenvĮxport the environment variable, run command one by one $ echo 'export PYENV_ROOT="$HOME/.pyenv"' > ~/.bash_profile Update existing Python version Safely in Catalina, BigSur: These days you most project demand python 3.x. Update Python 2 to 3 or install Python 3 on Your Mac OS by using Homebrew
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |