'When upgrading a package with pip it goes on an infinite loop
Where is there good pip documentation? I feel like I must be stupid because pip always ends up getting screwd in every single machine/OS I use.
Whenever I try to upgrade any package pip just iterates all versions without doing anything
Why is this happening? Example
pip install -U setuptools
Terminal:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: setuptools in ./.local/lib/python3.10/site-packages (62.1.0)
Collecting setuptools
Using cached setuptools-62.1.0-py3-none-any.whl (1.1 MB)
WARNING: Discarding https://files.pythonhosted.org/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl#sha256=26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8 (from https://pypi.org/simple/setuptools/) (requires-python:>=3.7). Requested setuptools from https://files.pythonhosted.org/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl#sha256=26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8 has inconsistent version: filename has '62.1.0', but metadata has '62.1.0'
Using cached setuptools-62.1.0.tar.gz (2.5 MB)
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing wheel metadata ... done
And this will iterated for god knows how long if I don't cancel it, going over every version of any package specified Here is the logs
2022-05-01T02:23:14,484 Using pip 21.0 from /usr/lib/python3.10/site-packages/pip (python 3.10)
2022-05-01T02:23:14,485 Defaulting to user installation because normal site-packages is not writeable
2022-05-01T02:23:14,516 Created temporary directory: /tmp/pip-ephem-wheel-cache-81kutz95
2022-05-01T02:23:14,516 Created temporary directory: /tmp/pip-req-tracker-y2gd2yu7
2022-05-01T02:23:14,516 Initialized build tracking at /tmp/pip-req-tracker-y2gd2yu7
2022-05-01T02:23:14,516 Created build tracker: /tmp/pip-req-tracker-y2gd2yu7
2022-05-01T02:23:14,516 Entered build tracker: /tmp/pip-req-tracker-y2gd2yu7
2022-05-01T02:23:14,516 Created temporary directory: /tmp/pip-install-wwa3f6hn
2022-05-01T02:23:14,521 Requirement already satisfied: setuptools in ./.local/lib/python3.10/site-packages (62.1.0)
2022-05-01T02:23:14,521 1 location(s) to search for versions of setuptools:
2022-05-01T02:23:14,521 * https://pypi.org/simple/setuptools/
2022-05-01T02:23:14,521 Fetching project page and analyzing links: https://pypi.org/simple/setuptools/
2022-05-01T02:23:14,521 Getting page https://pypi.org/simple/setuptools/
2022-05-01T02:23:14,522 Found index url https://pypi.org/simple
2022-05-01T02:23:14,523 Looking up "https://pypi.org/simple/setuptools/" in the cache
2022-05-01T02:23:14,523 Request header has "max_age" as 0, cache bypassed
2022-05-01T02:23:14,524 Starting new HTTPS connection (1): pypi.org:443
2022-05-01T02:23:14,595 https://pypi.org:443 "GET /simple/setuptools/ HTTP/1.1" 304 0
2022-05-01T02:23:14,755 Skipping link: unsupported archive format: .egg: https://files.pythonhosted.org/packages/77/38/90cae8fd99c5dc402d25930e1c91f5fcf6de5c8e982fd152a5a061e3df56/setuptools-0.6b1-py2.3.egg#sha256=ae0a6ec6090a92d08fe7f3dbf9f1b2ce889bce2a3d7724b62322a29b92cf93f0 (from https://pypi.org/simple/setuptools/)
2022-05-01T02:23:14,755 Skipping link: unsupported archive format: .egg: https://files.pythonhosted.org/packages/1f/ab/1ed6131b5112d1d47cb89e1cbea08f783f0ed49d6fc795ed2ff63f84d20c/setuptools-0.6b1-py2.4.egg#sha256=377ff1ce6d8e24842fbc5f7fdf1c64875f7fe9a1c4db9e7b7479cbce1377da86 (from https://pypi.org/simple/setuptools/)
2022-05-01T02:23:14,755 Found link https://files.pythonhosted.org/packages/82/cb/906d051fdf1c8b7703d288d3cc44ff32746090378f7f8539c8476a21ce9a/setuptools-0.6b1.zip#sha256=24197f28b1e09f669a5d68eb9ff95f317ec9217f580c34fa73a4d7e6c03f81cc (from https://pypi.org/simple/setuptools/), version: 0.6b1
2022-05-01T02:23:14,756 Skipping link: unsupported archive format: .egg: https://files.pythonhosted.org/packages/61/52/c84d22f3669ea8d4e54126f6241d7ed9828e3a382596f170043dfdaddbcc/setuptools-0.6b2-py2.3.egg#sha256=eac0fde9b41f392bcb41ea04975ed41a2e52a067cc14a2737344d3105d26844c (from https://pypi.org/simple/setuptools/)
2022-05-01T02:23:14,756 Skipping link: unsupported archive format: .egg: https://files.pythonhosted.org/packages/9b/87/48c155a10c4561fe9b8a83dcf9361ddb9cc9ab5c3ed1b504ac12ab11ed6a/setuptools-0.6b2-py2.4.egg#sha256=34a05e133ae5bafc5a0a3b8ca6da29ea3b01a5919a6f0044292220ccf02fc32f (from https://pypi.org/simple/setuptools/)
2022-05-01T02:23:14,756 Found link https://files.pythonhosted.org/packages/0e/3b/53daeaf6623a2bab3d3c40b19a35ff5bd7c4e1fbad2f537a61c1fe8c5069/setuptools-0.6b2.zip#sha256=0fdfd2765b4fee3bf7eeb0f9312743c8d81d575b6bd5e7c97c6e2694075a1f05 (from https://pypi.org/simple/setuptools/), version: 0.6b2
2022-05-01T02:23:14,756 Skipping link: unsupported archive format: .egg: https://files.pythonhosted.org/packages/c3/13/a3129905c118a7004e4bbc6db2c24d73de9e15960fd749a61e16fb114f30/setuptools-0.6b3-py2.3.egg#sha256=562410448caaa9295e2dfd07b62fcbc98e281fa0e63207986a0de03668dbb6c5 (from https://pypi.org/simple/setuptools/)
2022-05-01T02:23:14,756 Skipping link: unsupported archive format: .egg: https://files.pythonhosted.org/packages/10/b3/7166e400d3b953fa4714f97806f077a3f7791cd48ea71df708814234283a/setuptools-0.6b3-py2.4.egg#sha256=2ee23cccdd0ce61c50de9884c707a0c276c9a6fba2a2caa7257d27e2882d9fc4 (from https://pypi.org/simple/setuptools/)
2022-05-01T02:23:14,756 Found link https://files.pythonhosted.org/packages/ff/33/635de67bf3010651ba8db9d8064721274bfb6fbb778a110089f34beabaf2/setuptools-0.6b3.zip#sha256=0e20067e79c526755e63728b37893a94fc7fc1fd7e3c13d4f20b7ef572104b10 (from https://pypi.org/simple/setuptools/), version: 0.6b3
2022-05-01T02:23:14,756 Skipping link: unsupported archive format: .egg: https://files.pythonhosted.org/packages/1c/d7/6927233caddaa4f466a8b957c94be00810e751edb2655283c04fc3b680f2/setuptools-0.6b4-py2.3.egg#sha256=10b70a682ffacd93f8a56b4cdd1069e4c5027267c717f7764e1a1eaa1d00a265 (from https://pypi.org/simple/setuptools/)
2022-05-01T02:23:14,756 Skipping link: unsupported archive format: .egg: https://files.pythonhosted.org/packages/b3/79/8c94b6c99192df5f5d900ce17405cb5cfcdab8643d2e4aaf6ce1ee948576/setuptools-0.6b4-py2.4.egg#sha256=395ea10fe1908fcef2ac021b5c45e86e4a22da95ee6a6101a2cb16a983ddf16d (from https://pypi.org/simple/setuptools/)
2022-05-01T02:23:14,756 Found link https://files.pythonhosted.org/packages/82/be/b2e51157a4debc4ebcab179aeb839948a0f02ce06cbc7749c8ab866c0aa9/setuptools-0.6b4.zip#sha256=2815b909dbe274809c161377cea174cf185019fecded5f01de4d76959a0f06d2 (from https://pypi.org/simple/setuptools/), version: 0.6b4
...
(eventually finds links)
...
2022-05-01T02:23:14,959 Found link https://files.pythonhosted.org/packages/ea/a3/3d3cbbb7150f90c4cf554048e1dceb7c6ab330e4b9138a40e130a4cc79e1/setuptools-62.1.0.tar.gz#sha256=47c7b0c0f8fc10eec4cf1e71c6fdadf8decaa74ffa087e68cd1c20db7ad6a592 (from https://pypi.org/simple/setuptools/) (requires-python:>=3.7), version: 62.1.0
2022-05-01T02:23:14,971 Given no hashes to check 1141 links for project 'setuptools': discarding no candidates
2022-05-01T02:23:15,478 Collecting setuptools
2022-05-01T02:23:15,478 Created temporary directory: /tmp/pip-unpack-gqvdo0cu
2022-05-01T02:23:15,480 Looking up "https://files.pythonhosted.org/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl" in the cache
2022-05-01T02:23:15,482 Current age based on date: 7886
2022-05-01T02:23:15,482 Ignoring unknown cache-control directive: immutable
2022-05-01T02:23:15,482 Freshness lifetime from max-age: 365000000
2022-05-01T02:23:15,482 The response is "fresh", returning cached response
2022-05-01T02:23:15,482 365000000 > 7886
2022-05-01T02:23:15,482 Using cached setuptools-62.1.0-py3-none-any.whl (1.1 MB)
2022-05-01T02:23:15,488 Added setuptools from https://files.pythonhosted.org/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl#sha256=26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8 to build tracker '/tmp/pip-req-tracker-y2gd2yu7'
2022-05-01T02:23:15,489 Removed setuptools from https://files.pythonhosted.org/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl#sha256=26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8 from build tracker '/tmp/pip-req-tracker-y2gd2yu7'
2022-05-01T02:23:15,492 WARNING: Discarding https://files.pythonhosted.org/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl#sha256=26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8 (from https://pypi.org/simple/setuptools/) (requires-python:>=3.7). Requested setuptools from https://files.pythonhosted.org/packages/fb/58/9efbfe68482dab9557c49d433a60fff9efd7ed8835f829eba8297c2c124a/setuptools-62.1.0-py3-none-any.whl#sha256=26ead7d1f93efc0f8c804d9fafafbe4a44b179580a7105754b245155f9af05a8 has inconsistent version: filename has '62.1.0', but metadata has '62.1.0'
(repeat)
Can someone shed some light on what the issue might be here? This line here just makes me think pip is broken filename has '62.1.0', but metadata has '62.1.0'. I always end up with problems with pip and the documentation doesn't really help. I'm suffering. If anyone can help me with understanding pip or showing me some good documentation because I've seen colorschemes with better wikis/documentations than pip. Thank you
Error 2
This issue seems to not be that bad since pip outputs that the package is already up to date. However, my struggle with pip comes from other places. Here is another problem I would also appreciate some help
I have zscroll installed through pip, apparently, althought I installed it with paru.
Trying to upgrade it to see if the same problem would occur a different error occurs
pip install -U zscroll
Output
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: zscroll in /usr/lib/python3.10/site-packages (2.0.1)
ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
status = self.run(options, args)
File "/usr/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
return func(self, options, args)
File "/usr/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 316, in run
requirement_set = resolver.resolve(
File "/usr/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 121, in resolve
self._result = resolver.resolve(
File "/usr/lib/python3.10/site-packages/resolvelib/resolvers.py", line 454, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/usr/lib/python3.10/site-packages/resolvelib/resolvers.py", line 348, in resolve
failure_causes = self._attempt_to_pin_criterion(name, criterion)
File "/usr/lib/python3.10/site-packages/resolvelib/resolvers.py", line 217, in _attempt_to_pin_criterion
satisfied = all(
File "/usr/lib/python3.10/site-packages/resolvelib/resolvers.py", line 218, in <genexpr>
self._p.is_satisfied_by(requirement=r, candidate=candidate)
File "/usr/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 165, in is_satisfied_by
return requirement.is_satisfied_by(candidate)
File "/usr/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/requirements.py", line 112, in is_satisfied_by
return spec.contains(candidate.version, prereleases=True)
File "/usr/lib/python3.10/site-packages/packaging/specifiers.py", line 790, in contains
item = parse(item)
File "/usr/lib/python3.10/site-packages/packaging/version.py", line 57, in parse
return Version(version)
File "/usr/lib/python3.10/site-packages/packaging/version.py", line 296, in __init__
match = self._regex.search(version)
TypeError: expected string or bytes-like object
Logs
2022-05-01T03:04:53,090 Using pip 21.0 from /usr/lib/python3.10/site-packages/pip (python 3.10)
2022-05-01T03:04:53,091 Defaulting to user installation because normal site-packages is not writeable
2022-05-01T03:04:53,120 Created temporary directory: /tmp/pip-ephem-wheel-cache-7211z_oc
2022-05-01T03:04:53,120 Created temporary directory: /tmp/pip-req-tracker-0y16dy7o
2022-05-01T03:04:53,120 Initialized build tracking at /tmp/pip-req-tracker-0y16dy7o
2022-05-01T03:04:53,120 Created build tracker: /tmp/pip-req-tracker-0y16dy7o
2022-05-01T03:04:53,120 Entered build tracker: /tmp/pip-req-tracker-0y16dy7o
2022-05-01T03:04:53,121 Created temporary directory: /tmp/pip-install-xci_zo7l
2022-05-01T03:04:53,125 Requirement already satisfied: zscroll in /usr/lib/python3.10/site-packages (2.0.1)
2022-05-01T03:04:53,125 1 location(s) to search for versions of zscroll:
2022-05-01T03:04:53,125 * https://pypi.org/simple/zscroll/
2022-05-01T03:04:53,125 Fetching project page and analyzing links: https://pypi.org/simple/zscroll/
2022-05-01T03:04:53,125 Getting page https://pypi.org/simple/zscroll/
2022-05-01T03:04:53,126 Found index url https://pypi.org/simple
2022-05-01T03:04:53,126 Looking up "https://pypi.org/simple/zscroll/" in the cache
2022-05-01T03:04:53,126 Request header has "max_age" as 0, cache bypassed
2022-05-01T03:04:53,127 Starting new HTTPS connection (1): pypi.org:443
2022-05-01T03:04:53,201 https://pypi.org:443 "GET /simple/zscroll/ HTTP/1.1" 404 13
2022-05-01T03:04:53,202 Status code 404 not in (200, 203, 300, 301)
2022-05-01T03:04:53,202 Could not fetch URL https://pypi.org/simple/zscroll/: 404 Client Error: Not Found for url: https://pypi.org/simple/zscroll/ - skipping
2022-05-01T03:04:53,209 Given no hashes to check 0 links for project 'zscroll': discarding no candidates
2022-05-01T03:04:53,209 ERROR: Exception:
2022-05-01T03:04:53,209 Traceback (most recent call last):
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
2022-05-01T03:04:53,209 status = self.run(options, args)
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
2022-05-01T03:04:53,209 return func(self, options, args)
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 316, in run
2022-05-01T03:04:53,209 requirement_set = resolver.resolve(
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 121, in resolve
2022-05-01T03:04:53,209 self._result = resolver.resolve(
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/resolvelib/resolvers.py", line 454, in resolve
2022-05-01T03:04:53,209 state = resolution.resolve(requirements, max_rounds=max_rounds)
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/resolvelib/resolvers.py", line 348, in resolve
2022-05-01T03:04:53,209 failure_causes = self._attempt_to_pin_criterion(name, criterion)
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/resolvelib/resolvers.py", line 217, in _attempt_to_pin_criterion
2022-05-01T03:04:53,209 satisfied = all(
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/resolvelib/resolvers.py", line 218, in <genexpr>
2022-05-01T03:04:53,209 self._p.is_satisfied_by(requirement=r, candidate=candidate)
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 165, in is_satisfied_by
2022-05-01T03:04:53,209 return requirement.is_satisfied_by(candidate)
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/requirements.py", line 112, in is_satisfied_by
2022-05-01T03:04:53,209 return spec.contains(candidate.version, prereleases=True)
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/packaging/specifiers.py", line 790, in contains
2022-05-01T03:04:53,209 item = parse(item)
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/packaging/version.py", line 57, in parse
2022-05-01T03:04:53,209 return Version(version)
2022-05-01T03:04:53,209 File "/usr/lib/python3.10/site-packages/packaging/version.py", line 296, in __init__
2022-05-01T03:04:53,209 match = self._regex.search(version)
2022-05-01T03:04:53,209 TypeError: expected string or bytes-like object
2022-05-01T03:04:53,245 Removed build tracker: '/tmp/pip-req-tracker-0y16dy7o'
Althought not as bad as an infinite loop, still makes me believe there is something either wrong with pip or with pip in my machine, which is why I have been so desperate with pip, I installed it in a fresh OS just in the morning and it already is being a pain. I just need some help to know if the problem here is me because this has been a very frequent issue I've had with pip for a long time (it breaking after a while and the documentation not helping)
Solution 1:[1]
Update
I have fixed this issue.
I reinstalled pip with the ensurepip python's module
python -m ensurepip --upgrade
And now I have a working pip!
I am not sure what the previous problem was, I simply installed python-pip from the Arch Repository and it was kind of broken (perhaps I installed the wrong package), I also noticed that now pip is in .local/bin which I believe is where it belongs for a user installation.
Hope this can help anyone with the same issue
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gonçalo |
