2

I'm using Ubuntu 22.04 LTS, after the update, the default python changed to Python 3.10. However, most of the libraries I'm currently using are only available on 3.9.

when I try to install packages by

pip install mypackage

it is by default installed for python 3.10, V3.9 by

python3.9 -m pip install mypackage

I'm getting the following error,

from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'

It is essential that I should be able to install these modules for Python3.9. I tried to achieve the same by installing a Virtual environment using Pycharm and even inside this VE I'm getting this 'distutil' error. How can we fix this?

brownser
  • 545
  • 7
  • 25
  • 3
    https://stackoverflow.com/a/71977089/7976758 Try `sudo apt install python3.9-distutils` Found in https://stackoverflow.com/search?q=%5Bpip%5D+%22No+module+named+distutils.cmd%22 – phd Jun 02 '22 at 16:06
  • Thanks, that worked. I also had to add the deadsnakes ppa. – brownser Jun 02 '22 at 16:11

0 Answers0