Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Pythons without distutils #1910

Closed
gaborbernat opened this issue Jul 29, 2020 · 7 comments
Closed

Support Pythons without distutils #1910

gaborbernat opened this issue Jul 29, 2020 · 7 comments

Comments

@gaborbernat
Copy link
Contributor

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).

@hynek
Copy link

hynek commented Dec 11, 2020

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.

@jamesjjcondon
Copy link

@jamesjjcondon
Copy link

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 ?

@jamesjjcondon
Copy link

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

@freundTech
Copy link
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

@urkh
Copy link

urkh commented Apr 14, 2021

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

@gaborbernat
Copy link
Contributor Author

This has been done now.

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

No branches or pull requests

5 participants