Skip to content
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

ImportError on import espefuse line of custom python script (ESPTOOL-542) #797

Closed
belezyakov opened this issue Nov 17, 2022 · 2 comments
Closed

Comments

@belezyakov
Copy link

belezyakov commented Nov 17, 2022

Operating System

Ubuntu 20.04.5 and Debian GNU/Linux 10

Esptool Version

v4.3

Python Version

Python 3.8.10

Full Esptool Command Line that Was Run

import espefuse

Esptool Output

Traceback (most recent call last):
  File "/home/.../flasher_esp.py", line 4, in <module>
    import espefuse
  File "/home/.../my_env_folder/esptest/lib/python3.8/site-packages/espefuse/__init__.py", line 13, in <module>
    import espefuse.efuse.esp32 as esp32_efuse
  File "/home/.../my_env_folder/esptest/lib/python3.8/site-packages/espefuse/efuse/esp32/__init__.py", line 1, in <module>
    from . import operations
  File "/home/.../my_env_folder/esptest/lib/python3.8/site-packages/espefuse/efuse/esp32/operations.py", line 17, in <module>
    from . import fields
  File "/home/.../my_env_folder/esptest/lib/python3.8/site-packages/espefuse/efuse/esp32/fields.py", line 16, in <module>
    from .. import base_fields
  File "/home/.../my_env_folder/esptest/lib/python3.8/site-packages/espefuse/efuse/base_fields.py", line 13, in <module>
    from bitstring import BitArray, BitString, CreationError
ImportError: cannot import name 'BitString' from 'bitstring' (/home/.../my_env_folder/esptest/lib/python3.8/site-packages/bitstring.py)

What is the Expected Behaviour?

No error on importing espefuse

More Information

It seems like installing esptool in raw environment using pip collects bitstring wheel of new version 4.0.0 or 4.0.1 which satisfies requirement subitstring>=3.1.6, but incompatible with esptool. Preinstalling bitstring==3.1.9 eliminates the issue.

Other Steps to Reproduce

No response

@belezyakov belezyakov added the bug label Nov 17, 2022
@github-actions github-actions bot changed the title ImportError on import espefuse line of custom python script ImportError on import espefuse line of custom python script (ESPTOOL-542) Nov 17, 2022
@dobairoland
Copy link
Collaborator

Thanks @belezyakov for informing us. We will investigate....

The desired solution would be to keep compatibility with old and new bitstring as well.

@belezyakov
Copy link
Author

belezyakov commented Nov 21, 2022

According to bitstring release notes for v4.0.1:
Removed ConstBitArray and BitString class aliases. Use Bits and BitStream instead.

espressif-bot pushed a commit that referenced this issue Nov 21, 2022
Workaround for #797. The
proper solution will be added in a follow-up commit.
espressif-bot pushed a commit that referenced this issue Nov 23, 2022
bitstring==4 has several breaking changes and supports Python 3.7+ only.
Esptool==3.* should still support Python 2.7 and 3.4+.

Closes #797
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants