Can't upgrade linode-cli as pip3 gives errors
I'm using linode-cli to get kernel information, and it's now tell me I need to upgrade:
# linode-cli kernels view linode/latest-64bit --text --no-headers
The API responded with version 4.136.1, which is newer than the CLI's version of 4.118.0. Please update the CLI to get access to the newest features. You can update with a simple `pip3 install --upgrade linode-cli`
linode/latest-64bit Latest 64 bit (5.19.2-x86_64-linode156) 5.19.2 x86_64
I've tried to do the pip3 command to upgrade but it gives these errors:
# pip3 install --upgrade linode-cli
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 199, in _get_abstract_dist_for
skip_reason = self._check_skip_installed(req)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 170, in _check_skip_installed
self.finder.find_requirement(req_to_install, upgrade=True)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 572, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 534, in find_all_candidates
self._package_versions(page.iter_links(), search)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 702, in _package_versions
v = self._link_package_versions(link, search)
File "/usr/lib/python3/dist-packages/pip/_internal/index.py", line 777, in _link_package_versions
support_this_python = check_requires_python(link.requires_python)
File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 33, in check_requires_python
return python_version in requires_python_specifier
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 676, in __contains__
return self.contains(item)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 681, in contains
item = parse(item)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 219, in __init__
match = self._regex.search(version)
TypeError: expected string or bytes-like object
I've searched online extensively for similar errors in pip, and the closest answer I've found is this: https://github.com/pypa/pip/issues/11343
The relevant quote there is:
Your stack trace shows pip attempting to use packaging 19.0 from /usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl
As shown here pip 18.1 needs packaging 18.0.
So this could be a debundling issue by your Linux distributor or a broken pip installation on your machine.
This is not something the pip project can help with.
When I installed pip3 I followed instructions from Linode support and used these commands:
apt-get install python3 python3-pip
pip3 install linode-cli
I don't generally use python or pip, unless instructed to do so to install packages.
To my knowledge, this is the only other package I've installed via pip (installed when setting up emoncms):
pip3 install redis
Can anyone help with a solution?
2 Replies
Hey there,
What Linode distro are you using?
Also, can you dump the output from the following commands:
uname -a ;
python --version ;
apt list --installed ;
You may need to prepend sudo
to that last one.
Sorry for not replying - I only noticed the reply when I revisited the forum.
As it happens, this week I upgraded from Debian 10 to Debian 11, and had to reinstall linode-cli. It now works with no errors! It was presumably a mismatch with older packages on Debian 10?