Visitar URL original
Support Pythons without distutils · Issue #1910 · pypa/virtualenv · GitHub
Skip to content

Support Pythons without distutils #1910

Closed

Description

@gaborbernat

At the moment interpreter lookup fails when distutils is not available, e.g. on some Ubuntu Python distributions. Error:

113 failed to query /usr/bin/python3.6 with code 1 err: 'Traceback (most recent call last):\n  File "/home/manos/.local/lib/python3.8/site-packages/virtualenv/discovery/py_info.py", line 16, in <module>\n    from distutils.command.install import SCHEME_KEYS\nModuleNotFoundError: No module named \'distutils.command\'\n' [INFO cached_py_info:38]

See #1643 (comment).

Activity

  1. hynek commented on Dec 11, 2020

    @hynek

    To help desperate Googlers (me, yesterday): if you get RuntimeError: failed to find interpreter for Builtin discover of python_spec='3.9' on Ubuntu or debian and you positively know that the interpreter is installed, it might be that you're missing python3.9-distutils.

  2. jamesjjcondon commented on Feb 23, 2021

    @jamesjjcondon

    I'm having a similar issue trying to create a virtualenv with python3.7 on Ubuntu 20.04.
    Not missing python3.9-distutils. and python3.7-distutils not available. Above didn't help.

    Have got working on machine a) but not b). verbose traces below. Seems to be related to cpython version and proposed python path.

    machine a)
    image

    machine b)
    image

    Any pointers @gaborbernat ?

  3. jamesjjcondon commented on Feb 23, 2021

    @jamesjjcondon

    Don't know how but removing and purging python3.7 and reinstalling from deadsnakes seems to have fixed

  4. freundTech commented on Mar 16, 2021

    @freundTech
    Contributor

    Note that python 3.10 will deprecate distutils. Python 3.12 will completely remove it.
    See https://docs.python.org/3.10/whatsnew/3.10.html#distutils-deprecated

  5. urkh commented on Apr 14, 2021

    @urkh

    For those who have a similar problem with python3.7 or lower and use a .deb distro, the solution is to install the python*-distutils package according to the version of python that is failing. A quick and easy option is to add deadsnakes ppa and from there install the required python version along with distutils

    https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa

  6. gaborbernat commented on Jun 27, 2023

    @gaborbernat
    ContributorAuthor

    This has been done now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions