can't find python3, and missing .h files

With:

  • Arduino IDE 1.8.12
  • "git" version of the ESP8266 library and core, recently updated with "git pull"
  • python3 installed at "C:\Users\NewStdUser\AppData\Local\Programs\Python\Python38-32"
  • python2 installed at "C:\Python27"
    I get the following error messages (in bold below) and need help resolving them. Presumably I need to point the IDE to a different location for Python, but I don't know how to do that. Also not sure how to resolve the missing .h file problem.

This didn't happen before this update, when I was using a much older git version (from 2016, due to Found a way to upload data VERY fast by wifi · Issue #1853 · esp8266/Arduino · GitHub)

Arduino: 1.8.12 (Windows 7), Board: "Adafruit Feather HUZZAH ESP8266, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware

C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\NewStdUser\AppData\Local\Arduino15\packages -hardware C:\Users\NewStdUser\Documents\Arduino\hardware -tools

C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\NewStdUser\AppData\Local\Arduino15\packages -built-in-libraries

C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\NewStdUser\Documents\Arduino\libraries -fqbn=esp8266com:esp8266:huzzah:xtal=80,vt=flash,exception=legacy,ssl=all,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -ide-version=10812 -build-path

C:\Users\NEWSTD~1\AppData\Local\Temp\arduino_build_70484 -warnings=default -build-cache

C:\Users\NEWSTD~1\AppData\Local\Temp\arduino_cache_524007 -prefs=build.warn_data_percentage=75 -verbose C:\Users\NewStdUser\Documents\Arduino\BirdHouse\Wesp06c\Wesp06c.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\NewStdUser\AppData\Local\Arduino15\packages -hardware C:\Users\NewStdUser\Documents\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools

C:\Users\NewStdUser\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\NewStdUser\Documents\Arduino\libraries -fqbn=esp8266com:esp8266:huzzah:xtal=80,vt=flash,exception=legacy,ssl=all,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -ide-version=10812 -build-path

C:\Users\NEWSTD~1\AppData\Local\Temp\arduino_build_70484 -warnings=default -build-cache

C:\Users\NEWSTD~1\AppData\Local\Temp\arduino_cache_524007 -prefs=build.warn_data_percentage=75 -verbose C:\Users\NewStdUser\Documents\Arduino\BirdHouse\Wesp06c\Wesp06c.ino

Using board 'huzzah' from platform in folder: C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266

Using core 'esp8266' from platform in folder: C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266

"C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266/tools/python3/python3" "C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266/tools/makecorever.py" --build_path "C:\Users\NEWSTD~1\AppData\Local\Temp\arduino_build_70484" --platform_path "C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266" --version unix-2.7.0-dev
exec: "C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266/tools/python3/python3": file does not exist

Error compiling for board Adafruit Feather HUZZAH ESP8266.

Invalid library found in C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266\libraries\ESP8266SdFat: no headers files (.h) found in C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266\libraries\ESP8266SdFat

Invalid library found in C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266\libraries\SoftwareSerial: no headers files (.h) found in C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266\libraries\SoftwareSerial

DaveEvans:
exec: "C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266/tools/python3/python3": file does not exist

I haven't checked, but I would expect a dedicated copy of Python 3 to be installed by this step of the installation instructions:
https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version

  • Download binary tools
cd esp8266/tools

python3 get.py

Did you do that?

DaveEvans:

Invalid library found in C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266\libraries\ESP8266SdFat: no headers files (.h) found in C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266\libraries\ESP8266SdFat

Invalid library found in C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266\libraries\SoftwareSerial: no headers files (.h) found in C:\Users\NewStdUser\Documents\Arduino\hardware\esp8266com\esp8266\libraries\SoftwareSerial

These libraries are submodules of the esp8266/Arduino repository. When you clone the repository, the submodules are not populated, that is handled by this step of the installation instructions:

  • Initialize the submodules
cd %USERPROFILE%\Documents\Arduino\hardware\esp8266com\esp8266

git submodule update --init

Did you do that step?

Are you sure you need to use the git installation method? None of this is an issue if you use the Boards Manager installation method.

Is the python 3.x installation in your path? That installation process (and the core itself) assumes that it is.

Do you actually have a python3.exe (or symlink named that) in:
C:\Users\NewStdUser\AppData\Local\Programs\Python\Python38-32

Two nights ago I needed python3 for something. So I installed it. I realized I needed to have it in the path... but I already have the python 2.7 install in my path too!

(I didn't bother with that noise of a user-space folder, either - I don't recall if it defaulted to it, but I have UAC cranked back to it's most permissive settings anyway, so it doesn't give me a hard time about creating folders in the root of C: but when I saw this question I went and installed it on my other system (which happens to have more typical settings), because I was curious about whether the result was any different).

I discovered that only py.exe was in the path (at (user)\AppData\Local\Programs\Python\Launcher ), not python. And that python3.exe was not present anywhere, only python3.

So for me after that installation, the answer to both of those questions was "no".

The whole "python" vs "python3" thing is because of there being widespread use of two mutually incompatible versions of python, and people often need both - so it's become very common to have a symlink named python3 pointing to the python 3.x version of python

So I added both locations to my path (with priority for python 3 lower than python 2.7 install, so I wouldn't break anything by replacing python 2.7 with python 3.x) via control panel -> system -> advanced system settings, "advanced" tab, environment variables button. ie, for you:

C:\Users\NewStdUser\AppData\Local\Programs\Python\Python38-32
C:\Users\NewStdUser\AppData\Local\Programs\Python\Python38-32\Scripts

And then created a symlink from python3.exe to python.exe in the python3 install folder. Ie, for you, from command prompt:
mklink C:\Users\NewStdUser\AppData\Local\Programs\Python\Python38-32\python3.exe C:\Users\NewStdUser\AppData\Local\Programs\Python\Python38-32\python3.exe

After doing that, all seemed right with the world. Well, the part of my world consisting of my python installations. The rest of it is still a mess.

Thank you both for your replies. I haven't had time to study them or work on this; hope to get to it this weekend. I appreciate your help. +1 x 2 !

@pert - thanks again for your reply. I didn't do any of those steps because I thought doing this was all that was needed to update my "git" version:

When later updating your local library, goto the esp8266 directory and do a git pull

cd hardware\esp8266com\esp8266

git status
git pull

Using your comments and the guidance from @DrAzzy (thank you, again, too), I was able to eliminate the "python3 does not exist" error, but the "no headers" error persisted.

So, I completely removed the "git" version and tried the Boards Manager Installation Method. That resulted in many more (and different) compile errors, some apparently related to changes in the SD and SDfat libraries and use of SPIFFS.

So, I used a backup of my "git" version to revert back to where I was before this mess started. Thankfully, that allows me to compile without any errors.

Someday, when I have more time, I will re-write my code so that it works with the Boards Manager version of the core.

PS: DrAzzy ... In my case, the mklink needed to be:

mklink  C:\Users\NewStdUser\AppData\Local\Programs\Python\Python38-32\python3.exe C:\Users\NewStdUser\AppData\Local\Programs\Python\Python38-32\python.exe (note the 2nd .exe doesn't have the "3")