public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Adam Dinwoodie <adam@dinwoodie.org>
To: Jon Turney <jon.turney@dronecode.org.uk>,
	The Cygwin Mailing List <cygwin@cygwin.com>
Subject: Re: Missing Python dependencies for venv standard library module
Date: Fri, 10 Nov 2023 15:43:53 +0000	[thread overview]
Message-ID: <20231110154353.d2hqp6vxu7fokcrv@lucy.dinwoodie.org> (raw)
In-Reply-To: <45e21c6e-98a4-443b-bfbd-d3475c3452c0@dronecode.org.uk>

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.

  reply	other threads:[~2023-11-10 15:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08 16:17 Adam Dinwoodie
2023-11-10 14:35 ` Jon Turney
2023-11-10 15:43   ` Adam Dinwoodie [this message]
2023-11-27 17:15     ` Marco Atzeri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231110154353.d2hqp6vxu7fokcrv@lucy.dinwoodie.org \
    --to=adam@dinwoodie.org \
    --cc=cygwin@cygwin.com \
    --cc=jon.turney@dronecode.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).