mozilla-releng / build-mar

Utility for managing mar files
Mozilla Public License 2.0
8 stars 13 forks source link

ImportError: cannot import name lzma #54

Closed wellington1993 closed 2 years ago

wellington1993 commented 5 years ago

i''ve got this error:

Traceback (most recent call last):
  File "/home/wellington/.local/bin/mar", line 6, in <module>
    from mardor.cli import main
  File "/home/wellington/.local/lib/python2.7/site-packages/mardor/cli.py", line 14, in <module>
    from mardor.reader import MarReader
  File "/home/wellington/.local/lib/python2.7/site-packages/mardor/reader.py", line 13, in <module>
    from mardor.signing import get_signature_data
  File "/home/wellington/.local/lib/python2.7/site-packages/mardor/signing.py", line 17, in <module>
    from mardor.utils import file_iter
  File "/home/wellington/.local/lib/python2.7/site-packages/mardor/utils.py", line 13, in <module>
    from backports import lzma
ImportError: cannot import name lzma

How to solve?

Thanks!

wellington1993 commented 5 years ago

Temporary solved changing(commenting):

#if six.PY2:
#    from backports import lzma
#else:
import lzma

in ~/.local/lib/python2.7/site-packages/mardor/utils.py

Thanks!

catlee commented 5 years ago

Can you tell me where your lzma package comes from? It's not typically provided as part of a standard python 2.7 distribution.

wellington1993 commented 5 years ago

@catlee Sure, I found here:

<module 'lzma' from '/usr/lib/python2.7/dist-packages/lzma.x86_64-linux-gnu.so'>
wellington1993 commented 5 years ago

Appears to be deb depedency from one off my installed software: https://packages.ubuntu.com/bionic/amd64/python-lzma/filelist

wellington1993 commented 5 years ago

For example: torbrowser-launcher (https://ubuntu.pkgs.org/16.04/ubuntu-universe-amd64/python-lzma_0.5.3-3_amd64.deb.html)

jcristau commented 2 years ago

I don't think we'll work around this for 2.7, and https://docs.python.org/3/library/lzma.html was added in 3.3 so it won't happen there. Closing.