How to recover messed Python installation on a Mac?

Share This Post

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 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.

Detailed Procedure:

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.

Sample


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

spot_img

Related Posts

Python for Loop Iteration: How to Easily Manipulate a List

One of the most powerful features of the Python...

How To Get First Characters of a String in Python

Way to find the first characters of a string...

How To Convert Tuple To String In Python

In this post, you will learn how to convert...

How To Convert String to Double in Python

Good to hear, that you want to convert a...

Python TypeError: String Index Out Of Range Solution

A string is an array of characters and part...

How To Remove Empty Strings From a List Of Strings

On this page, we will discuss how to remove...
- Advertisement -spot_img