You are not logged in.
When I run any kubectl command (i.e.: kubectl version) it gives:
Traceback (most recent call last):
File "/usr/lib/python3.13/importlib/metadata/__init__.py", line 407, in from_name
return next(iter(cls.discover(name=name)))
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/aws", line 19, in <module>
import awscli.clidriver
File "/usr/lib/python3.13/site-packages/awscli/clidriver.py", line 52, in <module>
from awscli.autoprompt.core import AutoPromptDriver
File "/usr/lib/python3.13/site-packages/awscli/autoprompt/core.py", line 17, in <module>
from awscli.autoprompt.prompttoolkit import PromptToolkitPrompter
File "/usr/lib/python3.13/site-packages/awscli/autoprompt/prompttoolkit.py", line 18, in <module>
from prompt_toolkit.application import Application
File "/usr/lib/python3.13/site-packages/prompt_toolkit/__init__.py", line 32, in <module>
__version__ = metadata.version("prompt_toolkit")
File "/usr/lib/python3.13/importlib/metadata/__init__.py", line 987, in version
return distribution(distribution_name).version
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/importlib/metadata/__init__.py", line 960, in distribution
return Distribution.from_name(distribution_name)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/importlib/metadata/__init__.py", line 409, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for prompt_toolkit
Client Version: v1.32.3
Kustomize Version: v5.5.0
Unable to connect to the server: getting credentials: exec: executable aws failed with exit code 1
but when I use python console it does not produce error
Python 3.13.2 (main, Feb 5 2025, 08:05:21) [GCC 14.2.1 20250128] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib.metadata
>>> importlib.metadata.distribution("prompt_toolkit").version
'3.0.51'
>>> importlib.metadata.distribution("prompt_toolkit")
<importlib.metadata.PathDistribution object at 0x7e4f02370cd0>
>>>
What I've tried but to no avail:
1. Reinstall kubectl
sudo pacman -Syu kubectl
2. Reinstall aws-cli-v2 from AUR
sudo aura -Axc aws-cli-v2
3. Reinstall python
sudo pacman -Syu python
Last edited by swdmnd (2025-04-17 02:45:29)
Offline
I uninstall aws-cli-v2 from AUR, unable to reinstall (got the same error) and now use the one from official git here.
The problem goes away for now. Does anyone know what's wrong?
Offline
I have the same issue on my daily updated Arch, solved it the same way for now.
Offline
Alternatively, downgrade python-prompt_toolkit to 3.0.50-1. Even the Arch package for 3.0.51 has to use a venv to fix that issue.
Offline
Alternatively, downgrade python-prompt_toolkit to 3.0.50-1. Even the Arch package for 3.0.51 has to use a venv to fix that issue.
This should fix it for now. I'll mark this topic solved.
Offline
For the lazy:
```
sudo pacman -U /var/cache/pacman/pkg/python-prompt_toolkit-3.0.50-1-any.pkg.tar.zst
```
Offline
If nothing works above (as for me, downgrading the prompt_toolkit python package did not solved the compilation problems), for AWS CLI, there is an aws-cli-bin package in AUR, built from official AWS CLI binary provided by Amazon, and despite its name, it is a v2 AWS CLI so all new functions will work.
Offline
There's a python-prompt-toolkit in AUR that seems to be pinned to 3.0.50 https://cloud.google.com/storage/docs/a … th-helpers
Adding a `provides=("python-prompt_toolkit")` (might be worth adding a `conflicts`, too) to the PKGBUILD allows to build and re-install aws-cli-v2 without pulling python-prompt_toolkit-3.0.51 from the official repos.
Offline