[Bug 1851684] [NEW] python3.8-venv should depend on python3-distutils

Anthony Sottile 1851684 at bugs.launchpad.net
Thu Nov 7 17:13:44 UTC 2019


Public bug reported:

Originally reported here: https://github.com/deadsnakes/issues/issues/97

I'm also surprised to see a package added to LTS so late in the game, is
there a change in policy around new packages / feature bumps that I
missed?

Here's a reproduction using docker:

```
FROM ubuntu:bionic
RUN apt-get update && apt-get install -yq python3.8-venv
RUN python3.8 -m venv /venv
```

```
Step 3/3 : RUN python3.8 -m venv /venv
 ---> Running in 41a792e03c49
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-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/venv/bin/python3.8', '-Im', 'ensurepip', '--
upgrade', '--default-pip']

The command '/bin/sh -c python3.8 -m venv /venv' returned a non-zero code: 1
```

The inner (hidden) error:

```
root at f806220c24ec:/# python3.8 -mvenv /venv
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-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/venv/bin/python3.8', '-Im', 'ensurepip', '--
upgrade', '--default-pip']

root at f806220c24ec:/# /venv/bin/python -m ensurepip
Traceback (most recent call last):
  File "/usr/lib/python3.8/ensurepip/__init__.py", line 54, in _run_pip
    import pip._internal
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpmmf52da_/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 29, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpmmf52da_/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 23, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpmmf52da_/pip-9.0.1-py2.py3-none-any.whl/pip/locations.py", line 9, in <module>
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.8/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "/usr/lib/python3.8/ensurepip/__init__.py", line 263, in _main
    return _bootstrap(
  File "/usr/lib/python3.8/ensurepip/__init__.py", line 181, in _bootstrap
    return _run_pip(args + _PROJECTS, additional_paths)
  File "/usr/lib/python3.8/ensurepip/__init__.py", line 57, in _run_pip
    import pip
  File "<frozen zipimport>", line 259, in load_module
  File "/venv/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 29, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/venv/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 23, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/venv/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/locations.py", line 9, in <module>
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py)
```

** Affects: python3.8 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python3.8 in Ubuntu.
https://bugs.launchpad.net/bugs/1851684

Title:
  python3.8-venv should depend on python3-distutils

Status in python3.8 package in Ubuntu:
  New

Bug description:
  Originally reported here:
  https://github.com/deadsnakes/issues/issues/97

  I'm also surprised to see a package added to LTS so late in the game,
  is there a change in policy around new packages / feature bumps that I
  missed?

  Here's a reproduction using docker:

  ```
  FROM ubuntu:bionic
  RUN apt-get update && apt-get install -yq python3.8-venv
  RUN python3.8 -m venv /venv
  ```

  ```
  Step 3/3 : RUN python3.8 -m venv /venv
   ---> Running in 41a792e03c49
  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-get install python3-venv

  You may need to use sudo with that command.  After installing the python3-venv
  package, recreate your virtual environment.

  Failing command: ['/venv/bin/python3.8', '-Im', 'ensurepip', '--
  upgrade', '--default-pip']

  The command '/bin/sh -c python3.8 -m venv /venv' returned a non-zero code: 1
  ```

  The inner (hidden) error:

  ```
  root at f806220c24ec:/# python3.8 -mvenv /venv
  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-get install python3-venv

  You may need to use sudo with that command.  After installing the python3-venv
  package, recreate your virtual environment.

  Failing command: ['/venv/bin/python3.8', '-Im', 'ensurepip', '--
  upgrade', '--default-pip']

  root at f806220c24ec:/# /venv/bin/python -m ensurepip
  Traceback (most recent call last):
    File "/usr/lib/python3.8/ensurepip/__init__.py", line 54, in _run_pip
      import pip._internal
    File "<frozen zipimport>", line 259, in load_module
    File "/tmp/tmpmmf52da_/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 29, in <module>
    File "<frozen zipimport>", line 259, in load_module
    File "/tmp/tmpmmf52da_/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 23, in <module>
    File "<frozen zipimport>", line 259, in load_module
    File "/tmp/tmpmmf52da_/pip-9.0.1-py2.py3-none-any.whl/pip/locations.py", line 9, in <module>
  ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py)

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/runpy.py", line 192, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/lib/python3.8/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/usr/lib/python3.8/ensurepip/__main__.py", line 5, in <module>
      sys.exit(ensurepip._main())
    File "/usr/lib/python3.8/ensurepip/__init__.py", line 263, in _main
      return _bootstrap(
    File "/usr/lib/python3.8/ensurepip/__init__.py", line 181, in _bootstrap
      return _run_pip(args + _PROJECTS, additional_paths)
    File "/usr/lib/python3.8/ensurepip/__init__.py", line 57, in _run_pip
      import pip
    File "<frozen zipimport>", line 259, in load_module
    File "/venv/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 29, in <module>
    File "<frozen zipimport>", line 259, in load_module
    File "/venv/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 23, in <module>
    File "<frozen zipimport>", line 259, in load_module
    File "/venv/share/python-wheels/pip-9.0.1-py2.py3-none-any.whl/pip/locations.py", line 9, in <module>
  ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/__init__.py)
  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3.8/+bug/1851684/+subscriptions



More information about the foundations-bugs mailing list