Hello. I'm trying to upload a blank sketch to my Esp8266 esp-01 using the Arduino IDE 2.0.4 and I get the following error:
`Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00003578 (most recent call first):
exit status 3
Compilation error: exit status 3`
I would like to mention that I have tried to reinstall the IDE (deleting all the folders after uninstall) reinstall the boards esp8266 by esp8266 Community (a strange thing, after reintall, in the "Additional boards manager URLs" I still have the http://arduino.esp8266.com/stable/package_esp8266com_index.json address). Also I'm using a USB adapter dedicated for the esp-01 board (CH340-USB-To-ESP8266-ESP-01). And also I'm using Windows 7.
That error normally relates to an environment variable issue with the Python installation. I would expect the IDE install procedure to take care of all that but maybe it doesn't.
Someone like @ptillisch may be able to help.
Hi @georgepa. I'm going to ask you to post some additional information that might help us to identify the problem.
NOTE: These instructions will not solve the problem. They are only intended to gather more information which might provide a clue that eventually leads to a solution.
Please do this:
Select File > Preferences from the Arduino IDE menus.
Check the box next to "Show verbose output during: ☐ compilation".
Click the OK button.
Select Sketch > Verify/Compile from the Arduino IDE menus.
Wait for the compilation to fail.
You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the COPY ERROR MESSAGES button on that notification.
Open a forum reply here by clicking the Reply button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press Ctrl+V.
This will paste the compilation output into the code block.
Move the cursor outside of the code tags before you add any additional text to your reply.
Click the Reply button to post the output.
In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:
Open a forum reply here by clicking the Reply button.
Click the "Upload" icon () on the post composer toolbar:
Select the .txt file you saved.
Click the Open button.
Click the Reply button to publish the post.
Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.
Using board 'generic' from platform in folder: C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2
Using core 'esp8266' from platform in folder: C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2
"C:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\python3\\3.7.2-post1/python3" -I "C:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.1.2/tools/mkbuildoptglobals.py" "C:\\Users\\George\\AppData\\Local\\Programs\\arduino-ide\\resources\\app\\node_modules\\arduino-ide-extension\\build" 10607 "C:\\Users\\George\\AppData\\Local\\Temp\\arduino\\sketches\\F35C67CE0D6248D2DD027D24058D7622" "C:\\Users\\George\\AppData\\Local\\Temp\\arduino\\sketches\\F35C67CE0D6248D2DD027D24058D7622/core/build.opt" "C:\\Users\\George\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2023319-8764-fq9q4e.1liih\\sketch_apr19a/sketch_apr19a.ino.globals.h" "C:\\Users\\George\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\3.1.2\\cores\\esp8266/CommonHFile.h"
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x0000034c (most recent call first):
exit status 3
Compilation error: exit status 3
I see from the output that you are using the latest version of the ESP8266 boards platform (3.1.2). I was interested in this information because I found a bug report about this error message:
That bug was claimed to be fixed by a change made to the platform:
I had a hypothesis that you might be using an outdated version of the platform that didn't include the fix (which was released in 3.0.2), but I see now that I was wrong because you are using a version that includes the fix.
I did find another bug report:
The reporter provided instructions for a workaround for the bug:
If looking for it with your file browser or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".