Python Forum
pip doesn't work after Python upgrade
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pip doesn't work after Python upgrade
#1
Hello,

After upgrading Python 3.6 to Python 3.10, pip became broken:

Output:
pavel@ALABAMA:~$ pip3 --version Traceback (most recent call last): File "/home/pavel/.local/bin/pip3", line 5, in <module> from pip._internal.cli.main import main File "/usr/lib/python3/dist-packages/pip/__init__.py", line 22, in <module> from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 73, in <module> vendored("pkg_resources") File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 33, in vendored __import__(modulename, globals(), locals(), level=0) File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 77, in <module> File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/requirements.py", line 9, in <module> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 672, in _load_unlocked File "<frozen importlib._bootstrap>", line 632, in _load_backward_compatible File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/extern/__init__.py", line 43, in load_module File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/pyparsing.py", line 943, in <module> collections.MutableMapping.register(ParseResults) AttributeError: module 'collections' has no attribute 'MutableMapping' pavel@ALABAMA:~$
Any suggestions ?
Thanks.
Reply
#2
try

python3 -m pip install --upgrade pip
Reply
#3
(May-28-2022, 03:22 PM)Axel_Erfurt Wrote: try

python3 -m pip install --upgrade pip

"C:\Python-3.10.2\python.exe: No module named pip"
Reply
#4
(May-28-2022, 03:22 PM)Axel_Erfurt Wrote: try
python3 -m pip install --upgrade pip
I found where the problem is, but I don't know how to fix it.
The problem comes from the fact that I installed python 3.10 keeping the old 3.6.9.
It seems that gnome-terminal (my PC is running Ubuntu 18.04 LTS) is not compatible with python 3.10 because if I point python3 to 3.6.9 everything works.
So this reveals that I can't use gnome-terminal when python3 points to 3.10.
Any suggestions?
Reply
#5
Never change the system python. Just install a new version alongside and either run a virtual environment or put it first in your PATH.
Reply
#6
Quote:Never change the system python.
What do you mean by "system python" ?
I've just upgraded python (keeping old version) as I did it before.
The both 3.6.9 and 3.10 are python3, isn't it ?
The 1st line in gnome-terminal is: #!/usr/bin/python3.
So there is no distcinction between 3.6.9 and 3.10 given that the both are python3.

Quote:Just install a new version alongside
It's installed alongside: I can point python3 either to 3.6.9 either to 3.10.
When python3 points to 3.10, I can't use gnome-terminal which I got used to.

Quote:... put it first in your PATH
Can you elaborate, please.
Reply
#7
Is python3.10 in /usr/local/bin? I am on Ubuntu and that's where it is located on my box.
Will typing /usr/local/bin/python3.10 in a terminal start the version or just typing python3.10
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply
#8
(May-30-2022, 07:50 AM)menator01 Wrote: Is python3.10 in /usr/local/bin? I am on Ubuntu and that's where it is located on my box.
Will typing /usr/local/bin/python3.10 in a terminal start the version or just typing python3.10
On my PC both are in /usr/bin.
Reply
#9
What is the output in terminal

python3 --version


if you have multiple versions you could start your script with the specific version

python3 script.py

uses the default version

/path/to/python3.10 script.py

to use python3.10
Reply
#10
(May-30-2022, 11:41 AM)Axel_Erfurt Wrote: What is the output in terminal

python3 --version


if you have multiple versions you could start your script with the specific version

python3 script.py

uses the default version

/path/to/python3.10 script.py

to use python3.10

Output:
pavel@ALABAMA:~$ python3 --version Python 3.6.9
It's because I switched to 3.6.9.
When I switch to 3.10, gnome-terminal stops working.
So the question is: does exist some technique, allowing to have at the same time (1) python3 pointed to 3.10 and (2) working gnome-terminal ?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Why doesn't calling a parent constructor work with arbitrary keyword arguments? PurposefulCoder 4 870 Jun-24-2023, 02:14 PM
Last Post: deanhystad
  Python Version upgrade nitinkukreja 1 855 Feb-04-2023, 10:27 PM
Last Post: Larz60+
  Why doesn't this code work? What is wrong with path? Melcu54 7 1,681 Jan-29-2023, 06:24 PM
Last Post: Melcu54
  color code doesn't work harryvl 1 842 Dec-29-2022, 08:59 PM
Last Post: deanhystad
  Upgrade makes Code Error kucingkembar 6 2,971 Jul-28-2022, 06:44 PM
Last Post: kucingkembar
  client.get_all_tickers() Doesn't work gerald 2 1,664 Jun-16-2022, 07:59 AM
Last Post: gerald
  For Loop Works Fine But Append For Pandas Doesn't Work knight2000 2 1,930 Dec-18-2021, 02:38 AM
Last Post: knight2000
  Class Method to Calculate Age Doesn't Work gdbengo 1 1,660 Oct-30-2021, 11:20 PM
Last Post: Yoriz
  Process doesn't work but Thread work ! mr_byte31 4 2,556 Oct-18-2021, 06:29 PM
Last Post: mr_byte31
  Upgrade from 3.7.9 to 3.7.11 quazirfan 4 5,351 Sep-08-2021, 01:02 AM
Last Post: quazirfan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020