question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

current get_pip requires distutils.util - ubuntu18.04

See original GitHub issue

can the install of this not be done in the script?

/usr/bin/python3.6 get-pip.py --upgrade --force-reinstall
Traceback (most recent call last):
  File "get-pip.py", line 21492, in <module>
    main()
  File "get-pip.py", line 197, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip._internal
  File "/tmp/tmp2eupwih9/pip.zip/pip/_internal/__init__.py", line 40, in <module>
  File "/tmp/tmp2eupwih9/pip.zip/pip/_internal/cli/autocompletion.py", line 8, in <module>
  File "/tmp/tmp2eupwih9/pip.zip/pip/_internal/cli/main_parser.py", line 8, in <module>
  File "/tmp/tmp2eupwih9/pip.zip/pip/_internal/cli/cmdoptions.py", line 14, in <module>
ModuleNotFoundError: No module named 'distutils.util'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
antoineFraucommented, Oct 2, 2019

Hello, I have the same issue, trying to use get-pip.py with python3.6 and having the same error :

ModuleNotFoundError: No module named 'distutils.util'

So I try to run the command :

sudo apt install python3-distutils

But that’s telling me that will install python3.7

pi@raspberrypi:~ $ sudo apt install python3-distutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libpython3-stdlib libpython3.7-minimal libpython3.7-stdlib python3 python3-lib2to3 python3-minimal python3.7 python3.7-minimal
Suggested packages:
  python3-doc python3-tk python3-venv python3.7-venv python3.7-doc binfmt-support
The following NEW packages will be installed:
  libpython3-stdlib libpython3.7-minimal libpython3.7-stdlib python3 python3-distutils python3-lib2to3 python3-minimal python3.7 python3.7-minimal
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 4377 kB of archives.
After this operation, 22.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] ^C

So how does it works ? Does I need to install python3.7 to install pip for python3.6 ?

Thanks.

4reactions
pradyunsgcommented, Jun 20, 2019

Thanks for filing this!

As you noticed, Ubuntu ships their Python with a different structure, omitting parts of the standard library that pip depends on.

The best course of action here is to voice this concern and provide feedback to Ubuntu about this.

Oh, and apt install python-distutils. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'distutils.util'
The module not found likely means the packages aren't installed. sudo apt-get install python3-distutils sudo apt-get install python3-apt.
Read more >
How to install python-distutils for old python versions
It's very, very easy to get pip working with python3.8 on Ubuntu 20.04. It is, so far, impossible to get it working with...
Read more >
How to install pip without root access in Ubuntu > 18.04 ...
I would like to install pip within any of my virtual environments created with venv , but the get-pip.py script requires the distutils...
Read more >
modulenotfounderror: no module named 'distutils.util'
If the problem is still exist, you need to try to install the python distutils. ... pypa/get-pipcurrent get_pip requires distutils.util - ubuntu18.04#44.
Read more >
Docker – install python 3.7 in ubuntu 18.04 without having python ...
This would fail as python3.7-pip doesn't seem to exist; only python3-pip does, which is what installs python 3.6 for some reason. I tried...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found