I have a M1 Pro MBP and was trying to upgrade my default Python from V3.8.8 to V3.11.1 but now can no longer "see" any packages in Anaconda - python-3.x

In changing the symlink to V3.11.1, I've "lost" access to all Python packages installed under 3.8.8. Aanconda can't find any modules either, either under 3.8 or 3.11 and won't let me reinstall Anaaconda.
At the terminal prompt, I can get to V3.11.1 via Python3 command (not Python) and can see a list of modules but none of the packages previously installed. Tried to reinstall Anaconda but the installer says to upgrade instead. When I try to upgrade at the system prompt, "conda" isn't recognized.
I'm know my references are all messed up but not sure how to get my environment working. Appreciate any help/suggestions.

Related

How do I Upgrade Python in Virtual Environment

I have Python 3.10.9 globally, however version 3.9.15 is still showing up in the virtual environment.
How do I upgrade Python in my virtual enviroment?
Previously Anaconda was in the root path, and after many frustrating attempts I finally got rid of conda and miniconda3 in the path. Could this somehow be related to this issue?
Attempted to upgrade Python via Homebrew - which told me that version 3.10.9 is already installed, it's just not linked. I proceeded through the steps and attempted to link python#3.10 - however this failed, as version 3.9.15 is still showing.

"pip install requests" is returning "No module named 'requests'" on Python 3.11

I am new to Python and I have recently downloaded Python 3.11. Somehow I managed to download an earlier version of 3.6.X as well, but I have uninstalled the older version and I have installed the requests package using the command "pip install requests".
I am trying to learn web-scraping in Python, but I am having an issue with the requests module not being found.
I have read over many articles stating that the PATH may not be correct (it wasn't but is now), there may be multiple versions installed (that was also true but has now been corrected), or that pip needed to be upgraded.
Nothing has seemed to work to this point.
I did (at one time) have Python 3.6.X installed as well but I uninstalled this version and made sure that my pip install was upgraded to the newest version. I have also made sure the PATH is correct.
I am still having issues when trying to run "pip install requests" and I am getting an error stating "ModuleNotFoundError: no module named 'requests'".
When I run "python3 -m pip list" in my cmd prompt, I can see requests is installed under version 2.28.1.
Is there anything else I am missing that could be causing a compatibility issue?

Python Can't Use Pip After Uninstall 3.9

Problem
I Uninstalled Python 3.9 as I tried to import matplotlib
and would not work. After looking around for solutions I found out matplotlib may not be supported with 3.9 OK no problem. I'll uninstall 3.9 and install 3.7 Once done I tried to pip install matplotlib and the problem underlined in green (In photo). Happens I've change the environment variables as shown (In photo) and when I go into the file only 3.7 is there. Not sure why it's doing this maybe someone ran into the same issues as I but it was working fine until I uninstalled 3.9 I will keep it updated until CMD problem is sloved.
Solutions I Tried
Uninstalled and Reinstalled (From installer itself)
Remove environment variables and add environment variables again
Restarted Terminal and Computer
Repair Installation
where pip OUTPUT: "C:\Users\name\PycharmProjects\pythonProject\venv\Scripts\pip.exe C:\Users\name\AppData\Local\Programs\Python\Python37\Scripts\pip.exe)"
Change Environment Variable name from Python to Path
Update
I downloaded anaconda and using the powershell prompt and it seems to work now, but with the default CMD it does not work.
Solution Fixed for CMD
Found out pycharm projects did not remove the script files from 3.9 and had to go in manually and remove it C:\Users\name\PycharmProjects\pythonProject\venv\Scripts once any 3.9 scripts where removed I was then able to use pip as normal. Recommend either uninstall Pycharm or (IDE) and reinstall with correct interrupter I'f you're switching from 3.9 to lower.
Photo's
Here was the: Problem with CMD
Here's the: Solution Fixed with anaconda
Here's the: Solution Fixed with CMD
Try executing python -m pip install package
If you are in Linux, execute whereis python and then add a version to the PATH, then you can execute the pip as well.
Other way is to install a new version. PIP only works with a version of python installed

can't uninstall python3 in macOS

I am having trouble with my current python, so I wanted to uninstall my python and install the latest version. I installed with homebrew, so I uninstalled it with homebrew and reinstalled python 3.8.1 with the installer from the official site. Python3.8 was installed, but my python3 was not upgraded.
~ which python3
/usr/bin/python3
~ python3 --version
Python 3.7.3
I know I'm not supposed to(and I can't) manually delete things inside /usr/bin. What am I supposed to do?
When you installed Python with homebrew it told you this:
Unversioned symlinks python, python-config, pip etc. pointing to
python3, python3-config, pip3 etc., respectively, have been
installed into /usr/local/opt/python/libexec/bin
If you need a reminder, post install, you will get the same message if you run:
brew info python
It says "unversioned links are in /usr/local/opt/python/libexec/bin". That means, if you want to run Python without specifying the version, i.e. if you want to type this:
python
and this:
pip
to start Python 3 and its corresponding pip, you need to make sure your PATH has /usr/local/opt/python/libexec/bin at the start, i.e.
export PATH=/usr/local/opt/python/libexec/bin:$PATH
I could not uninstall the python3 in /usr/bin but found a workaround to give the python3 in /usr/loca/bin precedence by setting the PATH env variable as PATH=/usr/local/bin:$PATH. This gives binaries in /usr/local/bin precedence. Not a full fledged solution, but got me moving.

Why Cygwin can't find installed modules of python on windows?

After clean installation of Windows 10, I installed Python 3.7.1, and at the end of installation I chose to add it to Path Variables, which was asked in the options if I want to. Then I installed Cygwin, after which I did pip install --something inside Cygwin. But When I tried to import that module it throwed error cant find module.What is happening here?
You are mixing the installation and that does not work. If you need Python inside cygwin use its own version.
The last version of Cygwin Python 3 is 3.6.4-1
https://cygwin.com/packages/x86_64/python3/python3-3.6.4-1
If you need to upgrade the Windows installation run pip from outside the Cygwin enviroment

Resources