java.io.IOException: Cannot run program "python.exe": CreateProcess error=2

I have a Wemos D1 mini, that I want to send the blink sketch to over wifi.

when I upload over wifi I get this error message.

Arduino: 1.6.12 (Windows 10), Board: "WeMos D1 R2 & mini, 80 MHz, 921600, 4M (3M SPIFFS)"

" java.io.IOException: Cannot run program "python.exe": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
at cc.arduino.packages.uploaders.GenericNetworkUploader.uploadUsingPreferences(GenericNetworkUploader.java:97)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.SketchController.upload(SketchController.java:707)
at processing.app.SketchController.exportApplet(SketchController.java:680)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2176)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 8 more
An error occurred while uploading the sketch "

I updated java and python, restarted my PC
and no change.

help would be greatly appreciated

Please do this:

  • File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Sketch > Upload
  • After the upload fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • Paste the error messages in a reply here USING CODE TAGS (</> button on the toolbar).

</ Arduino: 1.6.12 (Windows 10), Board: "WeMos D1 R2 & mini, 80 MHz, 921600, 4M (3M SPIFFS)"

Sketch uses 222,201 bytes (21%) of program storage space. Maximum is 1,044,464 bytes.
Global variables use 31,576 bytes (38%) of dynamic memory, leaving 50,344 bytes for local variables. Maximum is 81,920 bytes.
python.exe C:\Users\alect\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/espota.py -i 192.168.1.108 -p 8266 --auth= -f C:\Users\alect\AppData\Local\Temp\arduino_build_351402/Blink.ino.bin
java.io.IOException: Cannot run program "python.exe": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
at cc.arduino.packages.uploaders.GenericNetworkUploader.uploadUsingPreferences(GenericNetworkUploader.java:97)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.SketchController.upload(SketchController.java:707)
at processing.app.SketchController.exportApplet(SketchController.java:680)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2176)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 8 more
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
/>

You forgot the code tags.

You need to add the folder that contains python.exe to your path:

  • Determine the path to the folder that contains python.exe. You can use Windows File Explorer for this.
  • In the search bar, type "System (Control Panel)"
  • Click on the matching search result
  • Click the "Advanced system settings" link.
  • Click the "Environment Variables" button.
  • In the section System Variables, find the PATH environment variable and select it.
  • Click the "Edit" button.
  • Click on the first blank line
  • Type the path to the folder that contains python.exe.
  • Click "OK"
  • Click "OK"
  • Click "OK"

Thank you very much. I see when i downloaded python I never added it as a PATH.

Much appreciated.

Hi pert,

I'm with the same problem.

I installed python again with the option to add environment variables enabled.

And I also added the PATH manually, unfortunately I still with the same error.

Do you imagine some other else problem ?

Many thanks

dandcj:
Hi pert,

I'm with the same problem.

I installed python again with the option to add environment variables enabled.

And I also added the PATH manually, unfortunately I still with the same error.

Do you imagine some other else problem ?

Many thanks

I had the same problem as yours, I restarted computer and it's solved!