Search code examples
pythonpython-3.xdebiandebian-buster

Debian10 python3 problems


I'm currently on Debian10:

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
...

and many python3 modules seems not installed:

$ lsb_release -a
Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 25, in <module>
    import lsb_release
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 29, in <module>
    import csv
ModuleNotFoundError: No module named 'csv'

If I create a python file with:

import asyncio

print("hello")

and launch it, I have:

$ python3 toto.py
Traceback (most recent call last):
  File "toto.py", line 1, in <module>
    import asyncio
  File "/usr/lib/python3.7/asyncio/__init__.py", line 8, in <module>
    from .base_events import *
  File "/usr/lib/python3.7/asyncio/base_events.py", line 18, in <module>
    import concurrent.futures
ModuleNotFoundError: No module named 'concurrent'

Any help is welcome to fix this mess :)


Solution

  • It appears you need to reinstall some of your Python 3.7 packages; given that concurrent.futures is missing, I suspect you need at least

    sudo apt install --reinstall libpython3.7-stdlib
    

    This will also fix your csv and cgi problems.