Multiple python versions causing pip failure

72 Views Asked by At

See Photo1. On executing --version, which and where command to python and python3, I discover to have python linked to ver 3.11 and python3 linked to 3.9.

See Photo2. I search all python related paths and see a few 3.9 paths and majority are 3.11 paths

Question:

What is the best way to 'gracefully' delete 3.9 and all its references?

a). Should i simply manually delete all 3.9 folders shown in Photo2? I fear if I break anything else unintentionally...

b). Also, would like to make python and python3 point to the 3.11

I believe this issue is rootcause to my previous post on pycaret installation: Pycaret installation on Mac unsuccessful via pip

enter image description here enter image description here

1

There are 1 best solutions below

2
PythonTester On

This is a poor question because it is attempting to get a response to poor practice.

Please take a different approach and consider creating a virtual environment for each project you work on.

Deleting system installed Python is not recommended.

A quick Google search for best practice for Python Environments will yield a more productive avenue for you to approach your problem.

My personal favorite is Poetry, however I would suggest you try a couple.

The first result I got has a reasonable approach outlined.

Additionally you may like to read the question and answers here:

What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?