I am having major difficulty in installing MicroPython onto an ESP3 using my RPi3B+ (may ask about this elsewhere) but for now I am trying to achieve this on a new fresh install/distro of Raspbian.

However, despite installing the esptool.py command correctly as per instructions, I get this error in the terminal when attempting to run it...

bash: esptool.py: command not found

To clarify a bit: I have a RPi3B+ with an existing distro where the esptool command works fine, and another distro which I created today using a separate SD card, where attempting to use the esptool yields the above error. So, on same RPi3B+ with distro 1: esptool works fine, with distro 2: esptool does not.

What I don't understand is that I am able to run this on my existing Raspbian Stretch distro without this error.

Any help greatly appreciated. Thanks

  • How did you install esptool.py? – CoderMike Feb 12 at 23:43
  • Hey Mike... I did this by following the instructions on the git page, using pip install esptool and also pip3 install esptool – John Feb 12 at 23:46
  • Sorry, it just occurred to me you may have wanted additional info. I installed from the terminal window that was opened after a reboot. I haven't changed passwords or directories on my new Raspbian distro, so installed in terminal pi@raspberrypi: Hope this helps. – John Feb 12 at 23:51
  • 1
    @Ingo - absolutely, thanks for the prompt. Is this done by clicking the tick next to the answer? Sorry... new to this process. – John Feb 14 at 12:25
  • 1
    Correct: the answer has now a green check mark, means the answer fixed your problem. Also in overviews of questions you find marks with the green background. – Ingo Feb 15 at 13:45

On your original working install you probably installed it with sudo. If you use

sudo pip3 install esptool

esptool.py works just calling it by name, but if you don't use sudo you have to specify the whole path and either set esptool.py as executable, run it with python 3 [path to esptool.py], or similar.

pip3 show esptool

will show you the path.

If you install with sudo, the path it installs to is


If you install without sudo, the path it installs to is


Also, have a look at these tutorials for micropython on the esp32 https://www.rototron.info/raspberry-pi-esp32-micropython-tutorial/ and pay attention to the changed memory address 0x1000 when writing the firmware. It was 0x0000 before.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.