Skip to content

Build: No module named 'distutils.spawn' #30189

Closed

Description

@guybedford
  • Version: master
  • Platform: WSL Ubuntu
  • Subsystem:

I know Node.js doesn't officially support Windows Subsystem for Linux, but I've been quite happily using this to develop on Windows for a while now.

Some recent change in the last week or two on master seems to be causing a build issue though as I now get the following output when running ./configure -

Traceback (most recent call last):
  File "./configure", line 20, in <module>
    from distutils.spawn import find_executable
ModuleNotFoundError: No module named 'distutils.spawn'

I have tried running git clean -fdx.

Any suggestions as to how to fix this would be a huge help to get going again here.

Activity

  1. richardlau commented on Oct 31, 2019

    @richardlau
    Member
    * **Version**: master
    
    * **Platform**: WSL Ubuntu
    
    * **Subsystem**:
    

    I know Node.js doesn't officially support Windows Subsystem for Linux, but I've been quite happily using this to develop on Windows for a while now.

    Some recent change in the last week or two on master seems to be causing a build issue though as I now get the following output when running ./configure -

    Traceback (most recent call last):
      File "./configure", line 20, in <module>
        from distutils.spawn import find_executable
    ModuleNotFoundError: No module named 'distutils.spawn'
    

    I have tried running git clean -fdx.

    Any suggestions as to how to fix this would be a huge help to get going again here.

    The recent change is most likely #30091 which now prefers Python 3 for configure. pypa/pipenv#2922 (comment) suggests a bug in Ubuntu's version of Python.

    A workaround would be to specify the version of Python used to run configure: python2 configure.py or python2.7 configure.py

  2. added
    pythonPRs and issues that require attention from people who are familiar with Python.
    wslIssues and PRs related to the Windows Subsystem for Linux.
    on Oct 31, 2019
  3. gengjiawen commented on Oct 31, 2019

    @gengjiawen
    Member

    Another workaround

    sudo apt install python3-distutils -y
  4. sam-github commented on Oct 31, 2019

    @sam-github
    Contributor

    @gengjiawen If python3-distutils is a required dep of our built for py3, it'd be really helpful if you could PR that to BUILDING.md, if you have time.

  5. guybedford commented on Oct 31, 2019

    @guybedford
    ContributorAuthor

    I can confirm sudo apt install python3-distutils -y fixed the issue here. Thanks so much for the quick responses. Shall I keep this open to track the documentation change?

  6. gengjiawen commented on Nov 1, 2019

    @gengjiawen
    Member

    @guybedford @sam-github I will try to add this to documentation, leave this open for now :)

  7. cclauss commented on Nov 2, 2019

    @cclauss
    Contributor

    The other solution seems to be python3 -m pip install setuptools.

  8. changed the title [-]Build issue on WSL[/-] [+]Build: No module named 'distutils.spawn'[/+] on Nov 2, 2019
  9. saladgg commented on Nov 26, 2020

    @saladgg

    Linux users

    If;
    sudo apt install python3-distutils -y;
    didn't work for you, ensure you have installed venv globally that corresponds to your python version i.e

    your_com:$sudo apt install python3.9-venv
    your_comp:
    /Desktop/your_prj$virtualenv venv --python=python3.9

  10. cclauss commented on Nov 26, 2020

    @cclauss
    Contributor

    distutils is being phased out as explained at https://docs.python.org/3/installing

    Python 3.3 and later has a builtin venv module https://docs.python.org/3/library/venv.html so virtualenv is not required and you can:

    python3 -m venv .venv
    source .venv/bin/activate
    pip install --upgrade pip
    [ ... ]
    deactivate
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pythonPRs and issues that require attention from people who are familiar with Python.wslIssues and PRs related to the Windows Subsystem for Linux.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions