PlatformIO IDE doesn't see Python3-venv on Linux

Ah! If only I’d scrolled back in this thread. My bad.

It seems I have no module named “ensurepip”:

ModuleNotFoundError: No module named 'ensurepip'

I do appear to have venv though but I don’t use it. At least, unless PlatformIO uses it under the covers. :wink:

python3 -m venv --help
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] [--upgrade]
            [--without-pip] [--prompt PROMPT] [--upgrade-deps]
            ENV_DIR [ENV_DIR ...]

Creates virtual Python environments in one or more target directories.

However, I needed to do this to actually get ensurepip to respond:

python3 --version
Python 3.10.6

apt search python3.10 | grep -e venv -e ensurepip

p   python3.10-venv                           - Interactive high-level object-oriented language (pyv
p   python3.10-venv:i386                      - Interactive high-level object-oriented language (pyv
v   python3.10-venv:any                       -  

This showed that python3.10-venv:any was not installed. I installed it with:

sudo apt install python3.10-venv

And after that, I get this:

python3 -m ensurepip --help
usage: python -m ensurepip [-h] [--version] [-v] [-U] [--user] [--root ROOT] [--altinstall]
                           [--default-pip]

And, on opening VSCode, the upgrade finishes. It looks like Linux MInt (Ubuntu and/or Debian also perhaps?) need to install the package python3.xx-venv in order to get the latest PlatformIO to install.

HTH

Cheers,
Norm.

1 Like