From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lucy.dinwoodie.org (a.a.7.1.1.a.0.5.1.b.f.e.e.4.8.c.d.a.0.2.5.1.e.d.0.b.8.0.1.0.0.2.ip6.arpa [IPv6:2001:8b0:de15:20ad:c84e:efb1:50a1:17aa]) by sourceware.org (Postfix) with ESMTPS id 525673858D37 for ; Fri, 10 Nov 2023 15:43:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 525673858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=dinwoodie.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinwoodie.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 525673858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:8b0:de15:20ad:c84e:efb1:50a1:17aa ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699631037; cv=none; b=eZZhF7KSg1WgYv0NFQjDAL7fbDKs2eLsdVR79AzRf00sKR/8dqYR62Zao3eVUp+m4CK+CDYSpujKIcFVJHNdIvBIPY9q0qhXPlviRsbVh2wtdVUQ38vESAkvTpwqdxpDF/BalQ9lgGM7z1+l9MwY+Zoqs7PAgCXLdajWgiV3dns= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699631037; c=relaxed/simple; bh=vF4HGUcjRChIkv6U0R5AIorSnrMohEwSNFOxiG9xvhs=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=mEGYYRJKWp4viUrkP6bmToYbnManSHoP/rNb8/OAVNBzGzjjJiB1ai7Tfef1+3BdlIPN30o+G7HrraSs4I90IncK0o1VcwO0TLtZs3nDFeQ84ukGNoWlT99FZNCodMpJUNu5HFq+FItPYLY9J9UoaSaErfa/EdINKnQmgRx9Uqo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from adam by lucy.dinwoodie.org with local (Exim 4.96) (envelope-from ) id 1r1Tfl-000dyT-1K; Fri, 10 Nov 2023 15:43:53 +0000 Date: Fri, 10 Nov 2023 15:43:53 +0000 From: Adam Dinwoodie To: Jon Turney , The Cygwin Mailing List Subject: Re: Missing Python dependencies for venv standard library module Message-ID: <20231110154353.d2hqp6vxu7fokcrv@lucy.dinwoodie.org> References: <20231108161743.fhr7sum3k445ag67@lucy.dinwoodie.org> <45e21c6e-98a4-443b-bfbd-d3475c3452c0@dronecode.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45e21c6e-98a4-443b-bfbd-d3475c3452c0@dronecode.org.uk> X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Nov 10, 2023 at 02:35:16PM +0000, Jon Turney wrote: > On 08/11/2023 16:17, Adam Dinwoodie via Cygwin wrote: > > Hullo, > > > > It looks like the python39 package is missing dependencies on > > python-setuptools-wheel and python-pip-wheel. I've not checked, but I > > suspect earlier Python versions are missing the same dependencies. > > Without these, the Python built-in venv module doesn't work: > > > > $ python3 -m venv v > > Error: Command '['/home/WDAGUtilityAccount/v/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. > > > > Compare when the both python-setuptools-wheel and python-pip-wheel are > > installed: > > > > $ python3 -m venv v > > $ . v/bin/activate > > (v) $ python3 -c 'import sys; print(sys.path)' > > ['', '/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-dynload', '/home/WDAGUtilityAccount/v/lib/python3.9/site-packages'] > > (v) $ deactivate > > > > I've attached cygcheck files from sandbox VMs for both the broken and > > working cases. I'm not sure what the correct fix is here -- possibly > > adding dependencies, possibly changing how things are packaged -- but > > I'd expect Python standard library modules to either work or to give an > > error message that makes it clearer what additional packages are > > required to make them work. > > Yeah. I have a vague recollection there was some other case recently where > one these being missing was causing some confusion. > > I think the easiest way to convince me that this is a historical oversight > would be to look how other distros do this: If they have python depend on > python-setuptools and python-wheel, then we probably should as well... I only have Debian set up to check quickly, but just looking at that example: - /usr/share/python-wheels/setuptools-66.1.1-py3-none-any.whl is provided by the python3-setuptools-whl package. - python3-setuptools-whl is required by python3.11-venv - python3.11-venv is required by python3-venv - python3-venv is suggested (*not* required) by python3 Slighly confusingly, python3.11-venv looks to only provide the ensurepip module; the venv module is provided by libpython3.11-stdlib, which is a requirement for python3, so it's only an Apt "suggestion" that gets this working there. However, Debian does provide a more useful error message when you don't have things installed usefully: $ python3 -m venv v The virtual environment was not created successfully because ensurepip is not available. On Debian/Ubuntu systems, you need to install the python3-venv package using the following command. apt install python3.11-venv You may need to use sudo with that command. After installing the python3-venv package, recreate your virtual environment. Failing command: /home/adam/v/bin/python3 So that's at least one other distro that is at least a bit more helpful. As I say, I don't have strong opinions on what the correct fix is here. Just adding the dependencies is an obvious option, and probably the easiest option from a maintainer perspective, but it's clearly not the only option.