TypeError: AsyncClient.init() got an unexpected keyword argument 'proxies'
Hi, I'm encountering a TypeError when using nala on Ubuntu 25.04:
TypeError: AsyncClient.init() got an unexpected keyword argument 'proxies'
The full traceback includes additional errors related to Nala’s async request system, but they appear to be consequences of the failed httpx.AsyncClient initialization. I post the full traceback log below this message.
This seems to originate from a breaking change in the httpx library used internally by Nala (or one of its dependencies).
I encountered this issue on a clean Ubuntu 25.04 install with:
- Nala version: 0.15.4
- Python version: 3.13.3
- httpx version: 0.28.1
I suspect that the issue is caused by incompatibility with the newer httpx API. I haven’t yet tested whether using an older version of httpx (e.g., <0.25.0) resolves the problem, and I’m unfortunately not familiar enough with the internals to investigate further. But I’m happy to share the logs.
Request:
Could you please check if Nala's use of httpx.AsyncClient can be adapted to the updated API, or if a dependency pin is necessary?
Thanks a lot for your great work on Nala!
sudo nala install vpnc
Installieren
Paket: Version: Größe:
vpnc 0.5.3+git20241126-1 94 KB
vpnc-scripts 0.1~git20220510-1 16 KB
=================================================================================================================== Vorgeschlagen, wird nicht installiert
Paket: Version: Größe:
dnsmasq 2.91-1 18 KB
openssh-server 1:9.9p1-3ubuntu3 625 KB
=================================================================================================================== Zusammenfassung
Installieren 2 Pakete
Gesamtgröße des Downloads 111 KB
Speicherplatz erforderlich 327 KB
Möchten Sie fortfahren? [J/n] j ╭─ Wird heruntergeladen… ─────────────────────────────────────────────────────────────────────────────────────────╮ │ Pakete insgesamt: 0/2 │ │ Downloads werden gestartet… │ │ Verbleibende Zeit: -:--:-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0% • 0.0/110.7 KB • ? │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────╮ │ /usr/lib/python3/dist-packages/nala/nala.py:378 in install │ │ │ │ 375 │ color_force: bool = COLOR, │ │ 376 ) -> None: │ │ 377 │ """Install packages.""" │ │ ❱ 378 │ install(pkg_names, ctx) │ │ 379 │ │ 380 │ │ 381 @nala.command(help=("Remove packages.")) │ │ │ │ ╭────────────────────────────── locals ──────────────────────────────╮ │ │ │ assume_yes = None │ │ │ │ auto_remove = None │ │ │ │ color_force = None │ │ │ │ ctx = <click.core.Context object at 0x712a70c296d0> │ │ │ │ debug = None │ │ │ │ default_release = None │ │ │ │ download_only = None │ │ │ │ dpkg_option = [] │ │ │ │ fix_broken = None │ │ │ │ install_recommends = None │ │ │ │ install_suggests = None │ │ │ │ man_help = None │ │ │ │ pkg_names = ['vpnc'] │ │ │ │ purge = None │ │ │ │ raw_dpkg = None │ │ │ │ remove_essential = None │ │ │ │ simple = None │ │ │ │ update = None │ │ │ │ verbose = None │ │ │ ╰────────────────────────────────────────────────────────────────────╯ │ │ │ │ /usr/lib/python3/dist-packages/nala/nala.py:195 in _install │ │ │ │ 192 │ │ │ error.unmarked_error(nala_pkgs.user_explicit) │ │ 193 │ │ │ 194 │ auto_remover(cache, nala_pkgs) │ │ ❱ 195 │ get_changes(cache, nala_pkgs, "install") │ │ 196 │ │ 197 │ │ 198 def remove_completion(ctx: typer.Context) -> Generator[str, None, None]: │ │ │ │ ╭─────────────────────────────── locals ───────────────────────────────╮ │ │ │ broken = [<Package: name:'vpnc' architecture='amd64' id:129614>] │ │ │ │ cache = <nala.cache.Cache object at 0x712a70c60ad0> │ │ │ │ ctx = <click.core.Context object at 0x712a70c296d0> │ │ │ │ not_exist = [] │ │ │ │ not_found = [] │ │ │ │ pkg_names = ['vpnc'] │ │ │ │ ver_failed = False │ │ │ ╰──────────────────────────────────────────────────────────────────────╯ │ │ │ │ /usr/lib/python3/dist-packages/nala/install.py:489 in get_changes │ │ │ │ 486 │ if arguments.raw_dpkg: │ │ 487 │ │ term.restore_locale() │ │ 488 │ │ │ ❱ 489 │ download_pkgs(pkgs) │ │ 490 │ start_dpkg(cache, nala_pkgs) │ │ 491 │ write_history(cache, nala_pkgs, operation) │ │ 492 │ │ │ │ ╭────────────────────────────────────────────────── locals ───────────────────────────────────────────────────╮ │ │ │ cache = <nala.cache.Cache object at 0x712a70c60ad0> │ │ │ │ nala_pkgs = PackageHandler( │ │ │ │ │ autoremoved=set(), │ │ │ │ │ user_explicit=[<Package: name:'vpnc' architecture='amd64' id:129614>], │ │ │ │ │ local_debs=[], │ │ │ │ │ not_needed=[], │ │ │ │ │ delete_pkgs=[], │ │ │ │ │ install_pkgs=[ │ │ │ │ │ │ NalaPackage( │ │ │ │ │ │ │ name='vpnc', │ │ │ │ │ │ │ version='0.5.3+git20241126-1', │ │ │ │ │ │ │ size=94490, │ │ │ │ │ │ │ old_version=None │ │ │ │ │ │ ), │ │ │ │ │ │ NalaPackage( │ │ │ │ │ │ │ name='vpnc-scripts', │ │ │ │ │ │ │ version='0.1~git20220510-1', │ │ │ │ │ │ │ size=16230, │ │ │ │ │ │ │ old_version=None │ │ │ │ │ │ ) │ │ │ │ │ ], │ │ │ │ │ reinstall_pkgs=[], │ │ │ │ │ upgrade_pkgs=[], │ │ │ │ │ autoremove_pkgs=[], │ │ │ │ │ autoremove_config=[], │ │ │ │ │ delete_config=[], │ │ │ │ │ recommend_pkgs=[], │ │ │ │ │ suggest_pkgs=[ │ │ │ │ │ │ NalaPackage(name='dnsmasq', version='2.91-1', size=17930, old_version=None), │ │ │ │ │ │ NalaPackage( │ │ │ │ │ │ │ name='openssh-server', │ │ │ │ │ │ │ version='1:9.9p1-3ubuntu3', │ │ │ │ │ │ │ size=625052, │ │ │ │ │ │ │ old_version=None │ │ │ │ │ │ ) │ │ │ │ │ ], │ │ │ │ │ configure_pkgs=[], │ │ │ │ │ downgrade_pkgs=[], │ │ │ │ │ held_pkgs=[] │ │ │ │ ) │ │ │ │ operation = 'install' │ │ │ │ pkgs = [ │ │ │ │ │ <Package: name:'vpnc' architecture='amd64' id:129614>, │ │ │ │ │ <Package: name:'vpnc-scripts' architecture='amd64' id:133923> │ │ │ │ ] │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /usr/lib/python3/dist-packages/nala/downloader.py:922 in download_pkgs │ │ │ │ 919 │ │ 920 def download_pkgs(pkgs: Iterable[Package]) -> None: │ │ 921 │ """Download package from a list of pkgs.""" │ │ ❱ 922 │ download( │ │ 923 │ │ Downloader( │ │ 924 │ │ │ # Start the larger files first, as they take the longest │ │ 925 │ │ │ sorted( │ │ │ │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │ │ │ pkgs = [ │ │ │ │ │ <Package: name:'vpnc' architecture='amd64' id:129614>, │ │ │ │ │ <Package: name:'vpnc-scripts' architecture='amd64' id:133923> │ │ │ │ ] │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /usr/lib/python3/dist-packages/nala/downloader.py:889 in download │ │ │ │ 886 │ Does not return if in Download Only mode. │ │ 887 │ """ │ │ 888 │ try: │ │ ❱ 889 │ │ run(downloader.start_download()) │ │ 890 │ except (CancelledError, RuntimeError) as error: │ │ 891 │ │ if downloader.exit: │ │ 892 │ │ │ sys.exit(downloader.exit) │ │ │ │ ╭────────────────────────────── locals ──────────────────────────────╮ │ │ │ downloader = <nala.downloader.Downloader object at 0x712a70c61010> │ │ │ ╰────────────────────────────────────────────────────────────────────╯ │ │ │ │ /usr/lib/python3.13/asyncio/runners.py:195 in run │ │ │ │ 192 │ │ │ "asyncio.run() cannot be called from a running event loop") │ │ 193 │ │ │ 194 │ with Runner(debug=debug, loop_factory=loop_factory) as runner: │ │ ❱ 195 │ │ return runner.run(main) │ │ 196 │ │ 197 │ │ 198 def _cancel_all_tasks(loop): │ │ │ │ ╭─────────────────────────────────── locals ────────────────────────────────────╮ │ │ │ debug = None │ │ │ │ loop_factory = None │ │ │ │ main = <coroutine object Downloader.start_download at 0x712a70cd3ac0> │ │ │ │ runner = <asyncio.runners.Runner object at 0x712a70c61160> │ │ │ ╰───────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /usr/lib/python3.13/asyncio/runners.py:118 in run │ │ │ │ 115 │ │ │ │ 116 │ │ self._interrupt_count = 0 │ │ 117 │ │ try: │ │ ❱ 118 │ │ │ return self._loop.run_until_complete(task) │ │ 119 │ │ except exceptions.CancelledError: │ │ 120 │ │ │ if self._interrupt_count > 0: │ │ 121 │ │ │ │ uncancel = getattr(task, "uncancel", None) │ │ │ │ ╭────────────────────────────────────────────────── locals ───────────────────────────────────────────────────╮ │ │ │ context = <_contextvars.Context object at 0x712a70ca83c0> │ │ │ │ coro = <coroutine object Downloader.start_download at 0x712a70cd3ac0> │ │ │ │ self = <asyncio.runners.Runner object at 0x712a70c61160> │ │ │ │ sigint_handler = functools.partial(<bound method Runner._on_sigint of <asyncio.runners.Runner object at │ │ │ │ 0x712a70c61160>>, main_task=<Task finished name='Task-1' coro=<Downloader.start_download() │ │ │ │ done, defined at /usr/lib/python3/dist-packages/nala/downloader.py:399> │ │ │ │ exception=TypeError("AsyncClient.init() got an unexpected keyword argument │ │ │ │ 'proxies'")>) │ │ │ │ task = <Task finished name='Task-1' coro=<Downloader.start_download() done, defined at │ │ │ │ /usr/lib/python3/dist-packages/nala/downloader.py:399> │ │ │ │ exception=TypeError("AsyncClient.init() got an unexpected keyword argument │ │ │ │ 'proxies'")> │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /usr/lib/python3.13/asyncio/base_events.py:719 in run_until_complete │ │ │ │ 716 │ │ if not future.done(): │ │ 717 │ │ │ raise RuntimeError('Event loop stopped before Future completed.') │ │ 718 │ │ │ │ ❱ 719 │ │ return future.result() │ │ 720 │ │ │ 721 │ def stop(self): │ │ 722 │ │ """Stop running the event loop. │ │ │ │ ╭────────────────────────────────────────────────── locals ───────────────────────────────────────────────────╮ │ │ │ future = <Task finished name='Task-1' coro=<Downloader.start_download() done, defined at │ │ │ │ /usr/lib/python3/dist-packages/nala/downloader.py:399> │ │ │ │ exception=TypeError("AsyncClient.init() got an unexpected keyword argument 'proxies'")> │ │ │ │ new_task = False │ │ │ │ self = <_UnixSelectorEventLoop running=False closed=True debug=False> │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /usr/lib/python3/dist-packages/nala/downloader.py:404 in start_download │ │ │ │ 401 │ │ if not self.pkg_urls: │ │ 402 │ │ │ return True │ │ 403 │ │ with Live(get_renderable=self._gen_table, refresh_per_second=10) as self.live: │ │ ❱ 404 │ │ │ async with AsyncClient( │ │ 405 │ │ │ │ timeout=20, │ │ 406 │ │ │ │ proxies=self.proxy, │ │ 407 │ │ │ │ follow_redirects=True, │ │ │ │ ╭─────────────────────────── locals ───────────────────────────╮ │ │ │ self = <nala.downloader.Downloader object at 0x712a70c61010> │ │ │ ╰──────────────────────────────────────────────────────────────╯ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ TypeError: AsyncClient.init() got an unexpected keyword argument 'proxies'