-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idf.py build -> python ImportError: cannot import name 'rest_of_line' from 'pyparsing'... (IDFGH-6867) #8489
Comments
Hi @Ampaex. Are you switching between ESP-IDF versions or have multiple copies in your computer? The above issue is caused by the fact that v5.0 is compatible with a different version of |
In case it is still not working then please share the output of |
Thanks for your help, I have already tried yesterday to run multiple times install.sh and export.sh, invoking get_idf on each console I started. Finally I ended up returning to v4.4 and it seems to work fine. |
Ok, I see. So I assume you don't want to experiment anymore. Just for future reference the following error indicates that you are running the environment of ESP-IDF v4.3 but using the code of ESP-IDF v5.0:
This error happen usually when the IDF_PATH environment variable is set to a different directory with a different version of ESP-IDF. |
The issue could be in your |
The thing is I only have one repository in "$HOME/esp/esp-idf" and didn't tried any version before, just cloned the master repository two weeks ago. |
Sorry for not being able to provide more information, I'm in a project and need the compiler working asap. |
Ok, I understand. We can get back to this if and when you will experience this issue again. |
python 3.6:
with virtualenv for python 3.9: python 3.6:
=> issue solved for me. |
facing the same error on windows , i have previously installed esp-idf lower version on the desktop folder ,after deleting it and removing all the path variables ,i reinstalled esp-idf v5.0 on another directory, after running install.ps1 and export.ps1 the output of the export shows that the right path viariable is added , but after checking the PATH ,i found out that the former path to the lower idf is added even if the IDF_PATH is correct, i manually added the right path , the error still exist |
Traceback (most recent call last): |
@lwshowl The issue is cause propably by the existence of the last item in your list (with |
Just ran into this issue myself. I upgraded from v4.4 to v5.0, deleted the entire I was able to resolve my issue by manually activating the The issue appears to have something to do with the Python virtual env selection. |
Looks like this issue was resolved just a few days ago (#9993). Temporary workaround is |
Windows / VS-Code / Platformio users, look here: |
File "/home/dave/esp/esp-idf/tools/ldgen/ldgen.py", line 16, in
File "/home/dave/esp/esp-idf/tools/ldgen/ldgen/entity.py", line 12, in
ImportError: cannot import name 'rest_of_line' from 'pyparsing' (/home/dave/esp/esp-matter/connectedhomeip/connectedhomeip/.environment/pigweed-venv/lib/python3.10/site-packages/pyparsing.py) ninja: build stopped: subcommand failed. I did a idf.py fullclean before I ran this build. Getting this while trying to build generic_switch. |
Take a close look at your python environment path: It is pointing to the virtual environment Matter/ConnectedHomeIP generated. Try to figure out where you espressif setup put its own environment and try to activate that, as jonathanforster suggested. It would be much much easier if espressif an matter could use just one and the same virtual environment for their python stuff! swg |
Environment
git describe --tags
to find it):v5.0-dev-1762-g6e0308d352
xtensa-esp32-elf-gcc --version
to find it):(crosstool-NG esp-2021r2-patch3) 8.4.0
Problem Description
Lately, when I tried to compile, I got to the point where I get the later mentioned error. This could be previously "solved" by doing a fullclean and compiling again.
Right now this error is not being "solved" anymore and I cannot continue building my project without errors, it's not an error that indicates easily where is the problem or any way of fixing it.
Expected Behavior
To build the project
Actual Behavior
Gives the error near the end of compilation.
Steps to reproduce
// If possible, attach a picture of your setup/wiring here.
Code to reproduce this issue
My code is really large and I don't know what is causing the problem.
Debug Logs
Other items if possible
build
folder (note this may contain all the code details and symbols of your project.)The text was updated successfully, but these errors were encountered: