I keep getting this error. My arduino version is (2.3.2).
Compilation error Error loading python.DLL, then points to me local
temp folder.This "mei161202/python27.dll(error code 14001) is not inside my folder.
Hi @endrewoh. I'm going to ask you to provide the full verbose output from a compilation.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
- Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open. - Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
- Click the "OK" button.
The "Preferences" dialog will close. - 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 the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the compilation output into the code block. - Move the cursor outside of the code block markup 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.
Click here for attachment instructions
- Open any text editor program.
- Paste the copied output into the text editor.
- Save the file in
.txt
format. - Open a forum reply here by clicking the "Reply" button.
- Click the "Upload" icon (
) on the post composer toolbar:
The "Open" dialog will open. - Select the
.txt
file you saved from the "Open" dialog. - Click the "Open" button.
The dialog will close. - 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.
endrewoh.txt (356.0 KB)
The error seems to be generated when Arduino IDE attempts to run the "esp32" boards platform's gen_esp32part.exe
tool.
My guess would be that it is caused by interference from your antivirus software.
Is there a specific reason you are using version 2.0.17 of the "esp32" boards platform instead of the latest version 3.0.2?
I ask because the gen_esp32part.exe
tool was updated after the time of the 2.0.17 release and now uses Python 3.x instead of 2.x (note the "27" in python27.dll
, which indicates that Python 2.7 was in use at the time the version of the gen_esp32part.exe
tool used by platform version 2.0.17 was built). It might be that the new version of the gen_esp32part.exe
tool will work correctly on your computer. If so, the easy fix would be updating the "esp32" boards platform installation.
I've removed ver 2.0.17 , and install the latest version 3.0.2
the earlier python error code dont pop up anymore.but there is still error.
In file included from C:\Users\ohrch\Documents\Arduino\EG336D\eg336d_lab2\eg336d_lab2.ino:2:
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src/M5StickCPlus.h:119:8: error: extended character “ is not valid in an identifier
119 | #error “This library only supports boards with ESP32 processor.”
| ^
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src/M5StickCPlus.h:119:64: error: extended character ” is not valid in an identifier
119 | #error “This library only supports boards with ESP32 processor.”
| ^
exit status 1
Compilation error: exit status 1
Great news!
This is caused by a bug in the "M5StickCPlus" library:
The bug has been fixed, but there hasn't been a new release of the "M5StickCPlus" library since that time so the version of the library you get from the Arduino IDE Library Manager still has the bug.
I'll provide instructions you can follow to install the beta version of the library that has the bug fixed:
- Click the following link to open the library's GitHub repository homepage in your web browser:
https://github.com/m5stack/M5StickC-Plus - Click the "Code ▾" button you see on that page.
- Select Download ZIP from the menu.
A download of the ZIP file of the library will start. - Wait for the download to finish.
- Select Sketch > Include library > Add .ZIP Library from the Arduino IDE menus.
The "Select the zip file containing the library you'd like to add" dialog will open. - Select the downloaded file from the dialog.
- Click the "Open" button.
The dialog will close. - A "Do you want to overwrite the existing library?" dialog will open. Click the "YES" button in the dialog.
- Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:
ⓘ Successfully installed library from M5StickC-Plus-master.zip archive
Now try compiling your sketch again. Hopefully this time there won't be any errors and everything will work as expected.
Hi Ptillishch,
I've followed as your instructions. There's still some compilation error, but i'm sure if its related to software bugs?
In file included from c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:16:
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'void TFT_eSPI::spi_begin()':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:231:5: error: 'GPIO' was not declared in this scope
231 | GPIO.out_w1tc = (1 << TFT_CS); \
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:58:9: note: in expansion of macro 'CS_L'
58 | CS_L;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'void TFT_eSPI::spi_end()':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:233:14: error: 'GPIO' was not declared in this scope
233 | #define CS_H GPIO.out_w1ts = (1 << TFT_CS) //;GPIO.out_w1ts = (1 << TFT_CS)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:74:13: note: in expansion of macro 'CS_H'
74 | CS_H;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'void TFT_eSPI::spi_begin_read()':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:231:5: error: 'GPIO' was not declared in this scope
231 | GPIO.out_w1tc = (1 << TFT_CS); \
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:93:9: note: in expansion of macro 'CS_L'
93 | CS_L;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'void TFT_eSPI::spi_end_read()':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:233:14: error: 'GPIO' was not declared in this scope
233 | #define CS_H GPIO.out_w1ts = (1 << TFT_CS) //;GPIO.out_w1ts = (1 << TFT_CS)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:112:13: note: in expansion of macro 'CS_H'
112 | CS_H;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'void TFT_eSPI::writecommand(uint8_t)':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:166:14: error: 'GPIO' was not declared in this scope
166 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC) //;GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:569:5: note: in expansion of macro 'DC_C'
569 | DC_C;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'void TFT_eSPI::writedata(uint8_t)':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:167:14: error: 'GPIO' was not declared in this scope
167 | #define DC_D GPIO.out_w1ts = (1 << TFT_DC) //;GPIO.out_w1ts = (1 << TFT_DC)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:585:5: note: in expansion of macro 'DC_D'
585 | DC_D; // Play safe, but should already be in data mode
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'uint8_t TFT_eSPI::readcommand8(uint8_t, uint8_t)':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:166:14: error: 'GPIO' was not declared in this scope
166 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC) //;GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:622:5: note: in expansion of macro 'DC_C'
622 | DC_C;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'uint16_t TFT_eSPI::readPixel(int32_t, int32_t)':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:233:14: error: 'GPIO' was not declared in this scope
233 | #define CS_H GPIO.out_w1ts = (1 << TFT_CS) //;GPIO.out_w1ts = (1 << TFT_CS)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:748:5: note: in expansion of macro 'CS_H'
748 | CS_H;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'void TFT_eSPI::readRect(int32_t, int32_t, int32_t, int32_t, uint16_t*)':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:233:14: error: 'GPIO' was not declared in this scope
233 | #define CS_H GPIO.out_w1ts = (1 << TFT_CS) //;GPIO.out_w1ts = (1 << TFT_CS)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:907:5: note: in expansion of macro 'CS_H'
907 | CS_H;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'void TFT_eSPI::readRectRGB(int32_t, int32_t, int32_t, int32_t, uint8_t*)':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:233:14: error: 'GPIO' was not declared in this scope
233 | #define CS_H GPIO.out_w1ts = (1 << TFT_CS) //;GPIO.out_w1ts = (1 << TFT_CS)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:1589:5: note: in expansion of macro 'CS_H'
1589 | CS_H;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'void TFT_eSPI::setWindow(int32_t, int32_t, int32_t, int32_t)':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:166:14: error: 'GPIO' was not declared in this scope
166 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC) //;GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:2949:5: note: in expansion of macro 'DC_C'
2949 | DC_C;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'void TFT_eSPI::readAddrWindow(int32_t, int32_t, int32_t, int32_t)':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:166:14: error: 'GPIO' was not declared in this scope
166 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC) //;GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:3083:5: note: in expansion of macro 'DC_C'
3083 | DC_C;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp: In member function 'virtual void TFT_eSPI::drawPixel(int32_t, int32_t, uint32_t)':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.h:166:14: error: 'GPIO' was not declared in this scope
166 | #define DC_C GPIO.out_w1tc = (1 << TFT_DC) //;GPIO.out_w1tc = (1 << TFT_DC)
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\In_eSPI.cpp:3318:5: note: in expansion of macro 'DC_C'
3318 | DC_C;
| ^~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\Speaker.cpp: In member function 'void SPEAKER::begin()':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\Speaker.cpp:10:5: error: 'ledcSetup' was not declared in this scope
10 | ledcSetup(TONE_PIN_CHANNEL, 0, 13);
| ^~~~~~~~~
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\Speaker.cpp:11:5: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?
11 | ledcAttachPin(SPEAKER_PIN, TONE_PIN_CHANNEL);
| ^~~~~~~~~~~~~
| ledcAttach
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\Speaker.cpp: In member function 'void SPEAKER::end()':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\Speaker.cpp:17:5: error: 'ledcDetachPin' was not declared in this scope; did you mean 'ledcDetach'?
17 | ledcDetachPin(SPEAKER_PIN);
| ^~~~~~~~~~~~~
| ledcDetach
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\Speaker.cpp: In member function 'void SPEAKER::playMusic(const uint8_t*, uint16_t)':
c:\Users\ohrch\Documents\Arduino\libraries\M5StickCPlus\src\utility\Speaker.cpp:79:5: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?
79 | ledcAttachPin(SPEAKER_PIN, TONE_PIN_CHANNEL);
| ^~~~~~~~~~~~~
| ledcAttach
exit status 1
Compilation error: exit status 1
Some significant breaking changes were introduced in the recent 3.0.0 release of the "esp32 boards platform that adds support to Arduino IDE for the ESP32-based boards:
https://github.com/espressif/arduino-esp32/blob/master/docs/en/migration_guides/2.x_to_3.0.rst#ledc
Some of the breaking changes in the platform broke the library code. This is the cause of the errors you are now getting.
The solution will be to roll back to the last compatible version (2.0.17) of the "esp32 platform. I'll provide instructions you can follow to do that:
- Select Tools > Board > Boards Manager... from the Arduino IDE menus.
The "Boards Manager" dialog will open. - Wait for the updates to finish, as shown by the messages printed at the bottom of the "Boards Manager" dialog.
- Scroll down through the list of boards platforms until you find the "esp32" entry. Click on it.
A "Select version" dropdown will appear in the entry. - Click on the "Select version" dropdown.
It will expand. - Select "2.0.17" from the menu.
- Click the "Install" button in the "esp32" entry.
- Wait for the installation to finish.
- Click the "Close" button on the "Boards Manager" dialog.
The "Boards Manager" dialog will close.
Now compile your sketch again. Hopefully this time the error will not occur and the library will work as expected.
Arduino IDE will occasionally notify you that a new version of the boards platform is available, you'll need to refrain from accepting the offer that will cause an update back to the problematic version of the platform. If you find these notifications annoying, you can disable them via the IDE preferences.
I'll provide instructions you can follow to do that:
- Select File > Preferences... (or Arduino > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open. - Uncheck the box next to "Check for updates on startup" in the "Preferences" dialog.
- Click the "OK" button.
The "Preferences" dialog will close.
If you disable the automatic update check, make sure to periodically do a manual check for newer versions of the installed boards platforms and libraries that you want to keep updated. You can check for new versions of Arduino IDE by selecting Help > Check for Arduino IDE Updates from the Arduino IDE menus. You can check for new versions of boards platforms and libraries by selecting "Updatable" from the "Type" menu in the Boards Manager and Library Manager views.
You should keep a watch for an update of the "M5StickCPlus" library. It is likely the compatibility problems will be fixed in the next release of the library. So after you update to a new version of the library, you can also use the Arduino IDE Boards Manager to update the "esp32" boards platform to the latest version again.
Hi Ptillisch,
When I roll back to version 2.0.17, I will get the python27.DLL error.
Error loading Python DLL: C:\Users\ohrch\AppData\Local\Temp_MEI65122\python27.dll (error code 14001)
exit status 0xffffffff
Compilation error: exit status 0xffffffff
OK, I should have seen that coming but I forgot the earlier context of our conversation.
The workaround will be to manually replace the old incompatible version of the gen_esp32part.exe
tool with the new version. Hopefully the two will be functionally equivalent.
I'll provide instructions you can follow to do that:
- Click the following link to open the GitHub page for this tool in your web browser:
https://github.com/espressif/arduino-esp32/blob/3.0.2/tools/gen_esp32part.exe - Click the downward pointing arrow icon ("Download raw file") at the right side of the toolbar on that page:
Your browser will start a file download. - Wait for the download to finish.
- Delete the file at the following path on your hard drive:
C:\Users\ohrch\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.17\tools\gen_esp32part.exe
- Copy the downloaded file to the folder where you deleted the existing file in the previous step:
C:\Users\ohrch\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.17\tools\
Now try compiling your sketch again. Hopefully this time everything will work correctly.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.