0

I had my previous python3.7 installed by Anaconda and then I installed python3.9 using homebrew. Then things really messed up. When I check my packages using pip3 list, it shows no packages installed. I suppose it was sourcing the site-packages under python3.9. However, when I run python in terminal (which python3), it showed that I was still running the old python3.7 which had all my packages. The problem is whenever I installed new packages, it didn't work because I was still running the old python3.7 while new packages were installed to python3.9.

Question:

  1. How can I make my python version consistent, e.g. I only want to use one python and preferably the later version --python3.9.
  2. How should I manage my packages. There are a lot of them and I really don't want to install every single one again on python3.9

Thank you very much!

1 Answer 1

1

Make a list of your pip installed pacakages:

pip3 freeze > my_packages.txt

Uninstall python3.7:

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

With your new install of python3.9, install the previous packages:

pip3 install -r my_packages.txt
Sign up to request clarification or add additional context in comments.

10 Comments

Thank you for your answer. For the 1st step, however, I wasn't able to make a list of my previous pip3 packages. What should I do about that?
type "pip list -o" into your terminal. You should get some packages. I found this link what may help you.
This is what I got with pip3 list -o: idna 2.10 3.1 wheel setuptools 51.0.0 51.3.1 wheel wheel 0.36.1 0.36.2 wheel
I take it that's not all your packages? If it isn't I don't particularly know what's wrong. Did you mess with or delete anything?
Right. I'm missing my packages. I suppose the problem is a linking problem because I have pythons installed by anaconda and homebrew. For some reasons, the default python3 is still the anaconda python3.7 but the pip3 is using pip3.9 and there isn't any packages installed under that site-packages directory.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.