7

I am pulling my hair out over this issue.

I am not a python user so following random instructions I find anywhere to solve this issue but nothing works.

Basic problem is that I am trying to use ensurepip but it does not exist.

$ python3 -m ensurepip
/usr/bin/python3: No module named ensurepip

My python3 pip is up to date

$ sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pip is already the newest version (23.0.1+dfsg-1).
0 to upgrade, 0 to newly install, 0 to remove and 35 not to upgrade.

I've seen suggestions about using a venv but no idea how to do that so other apps on the system would be able to use it without me having to do anything to them, but I don't really understand venv so may be missing the point.

I've seen other mentions that pip or ensurepip is intentionally disabled on ubuntu/debian but don't understand why that would be true as so many apps rely on using pip/ensurepip.

I just don't know what to do.

Kubuntu 23.04
Python 3.11.2
  • what are you trying to do that you need ensurepip? ensurepip installs pip, but it looks like you have pip working already? This sounds like an X/Y question: what are you trying to solve by using ensurepip? – Esther May 23 '23 at 14:53
  • @Esther This all started when I tried to install a module in Blender which borked. The error message I got was "import ensurepip ModuleNotFoundError: No module names ensurepip". So I went looking for ensurepip as that's the module it says is missing. I am not a python user so no idea what to do. – nobody special May 24 '23 at 00:49

1 Answers1

6

It looks like ensurepip is not present by default when installing python through apt in Ubuntu. I managed to get it working by running:

# Adjust for your python version
sudo apt-get install python3.9-venv
DieterDP
  • 161