Last Updated on July 18, 2021 by admin
There are many different python translators and different symlinks. So, in this article, we are going to recover messed python installation on a mac.
First of all, delete all the python packages which you have installed. You did it to get a fresh start on your mac.
Recover messed Python installation on a Mac
The first step is to delete and remove the pip. Remove all third-party python that is installed in your mac.
Be careful and Do not delete anything under the /System/folder. Otherwise, you will have to reinstall the macOS.
Secondly, Edit the Shell profile you have, such as .bash_profile or .zshrc and .zprofile, any shell you use.
Then, Delete all lines with Python and add a framework to it.
In other words, remove old python-related methods.
If you have an anaconda installed, discard that again.
Until now, all of this was normal. What matters is how you install the new version.
Here’s the exciting part: if you’ve already damaged your python in your mac, then there’s a good chance you can corrupt permissions with specific packages as well.
So if you want to introduce new python models it will seem to work well, but it will become an activist over time.
That is why the following step is so important. Now, adjust old package permissions.
Everything in this folder should NOT require root privileges, which, if they do, give the pip a hard time later.
Now that you’ve fixed the permissions, you can go ahead and install the python2 interpreter, which won’t want Sudo through the pip so that you will install your packages properly.
Here is the sample of the task.
Sudorm -rf /Library/Frameworks/Python.framework Sudorm -rf “/Applications/Python 2.7” Cd /usr/local/bin/ Ls -l /usr/local/bin | grep ‘../Library/
Read More: 3 Best Ways to Exit a Python Program