ImportError: No module named setuptools on Raspbian OS

52 Views Asked by At

I tried to install the Adafruit Python DTH on my Raspberry Pi Zero 2 W (Raspbian64 OS) according to this tutorial - see section PROGRAMMING THE DHT11 WITH PYTHON

For the last step sudo python setup.py install I get following error:

Traceback (most recent call last):
  File "setup.py", line 1, in <module>
    from setuptools import setup, find_packages, Extension
ImportError: No module named setuptools

I then also installed setuptools which looked successful, but above message keep displaying. After installation of setuptools I could not call any command like setuptools..

Anybody here with similar experience or has already a solution?

1

There are 1 best solutions below

0
matan h On

The first thing I would try is to install setuptools using apt (which is the system package manager):

sudo apt install python3-setuptools

If this didn't work you can use the method described in this blog post from 2012 about Raspberry Pi:

mkdir python-setuptools
cd python-setuptools
wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python

Then download whatever module you need and run the setup.py program using the command:

sudo python setup.py install