scott-griffiths / bitstring

A Python module to help you manage your bits
https://bitstring.readthedocs.io/en/stable/index.html
MIT License
401 stars 67 forks source link

ImportError: cannot import name 'BitString' from 'bitstring' #314

Closed hddesai closed 4 months ago

hddesai commented 4 months ago

Hello,

I installed illuminate in a conda environment with python3.8. When I import illuminate, I receive the following error. Am I missing a dependency for this import or what can I do to import bitstring?

ImportError: cannot import name 'BitString' from 'bitstring' (/home/m305908/miniconda3/envs/python3.8/lib/python3.8/site-packages/bitstring/init.py)

Thank you!

scott-griffiths commented 4 months ago

Hi. I'm not sure what exactly 'illuminate' is in this context so I can't really take a look.

The underlying issue is that there is no class called BitString in the bitstring library. There did used to be, but it was deprecated a long time ago and the final alias for it was removed in bitstring 4.0.

I'd suggest using pip to install bitstring 3.1.9 as the most recent one that may work. Chances are that a dependency on bitstring was added somewhere without limiting the version number, so you have ended up with the latest version which is no longer compatible.

scott-griffiths commented 4 months ago

I just checked - the BitString class was deprecated over 13 years ago! 😄

hddesai commented 4 months ago

wow! Good to know - I will look for other solutions. I appreciate the help and quick feedback. :). I think I tried 3.1.9 and had the same issue. I was just trying to test illuminate which parses illumina interop folders for sequencing run metrics to see if it's a good solution. There's other packages out there.