🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.maint.python
Article #83

Installing ‘python-apt-binary’ from PyPI using ‘python3 -m pip’

#83
From: Ben Finney
Date: Mon, 30 Nov 2026 05:40
34 lines
3266 bytes
Howdy all,

I'm attempting to install Debian's APT bindings for Python, in a
virtualenv and/or ‘pyproject.toml’ project dependencies, so that
programs can (for example) `import apt_pkg`. How should that be done?


The ‘python-apt’ entry at PyPI has been obsolete for years, and was
“yanked” in 2023. It has no installable version published. Similarly for
the ‘apt’ entry at PyPI.

>From what I can tell, the ‘python-apt-binary’ PyPI entry is what I need
<URL: https://pypi.org/project/python-apt-binary/> (though its metadata
is sparse and unhelpful). But when I attempt to install it:

=====
$ python3 -m pip install python-apt-binary
ERROR: Could not find a version that satisfies the requirement
    python-apt-binary (from versions: none)
ERROR: No matching distribution found for python-apt-binary
=====

The <URL: https://pypi.org/project/python-apt-binary/#history> release
history of the PyPI entry shows sporadic entries, with version “3.0.0”
the latest, on 2026-09-15. Why does that not match the specified
‘python-apt-binary’ request?

How should I be getting this dependency satisfied in a Python project?

-- 
 \       “Crime is contagious… if the government becomes a lawbreaker, |
  `\          it breeds contempt for the law.” —Justice Louis Brandeis |
_o__)                                                                  |
Ben Finney
Technical Details
Message-ID: <O52hj-f3Kd-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomod
From: Ben Finney <bignose@debian.org>
Newsgroups: linux.debian.maint.python
Subject: Installing ‘python-apt-binary’ from  PyPI using ‘python3 -m pip’
Date: Mon, 30 Nov 2026 06:40:01 +0100
Message-ID: <O52hj-f3Kd-3@gated-at.bofh.it>
X-Original-To: debian-python@lists.debian.org
X-Mailbox-Line: From debian-python-request@lists.debian.org  Mon Nov 30 05:38:54 2026
Old-Return-Path: <debian-python@m.gmane-mx.org>
X-Amavis-Spam-Status: No, score=-1.751 tagged_above=-10000 required=5.3
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249] autolearn=no autolearn_force=no
X-Policyd-Weight: using cached result; rate: -4.6
X-Injected-Via-Gmane: http://gmane.org/
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:7gJ3RIroLyt/MfRWmgYJNf8+AP4=
X-Public-Key-ID: 0xAC128405
X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35  4855 B8B2 4C06 AC12 8405
X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From: Ben Finney <bignose+hates-spam@benfinney.id.au>
X-Mailing-List: <debian-python@lists.debian.org> archive/latest/24208
List-ID: <debian-python.lists.debian.org>
List-URL: <https://lists.debian.org/debian-python/>
List-Archive: https://lists.debian.org/msgid-search/87zeuqop45.fsf@benfinney.id.au
Approved: robomod@news.nic.it
Lines: 34
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Mon, 30 Nov 2026 16:38:34 +1100
X-Original-Message-ID: <87zeuqop45.fsf@benfinney.id.au>