cget icon indicating copy to clipboard operation
cget copied to clipboard

global name 'lzma' is not defined

Open welchr opened this issue 5 years ago • 1 comments

If I use cget installed in a python 2.7 virtualenv, and then install a package that is contained in a .xz archive, it will fail with:

Downloading http://sourceforge.net/projects/arma/files/armadillo-9.200.7.tar.xz
  [######################################################################]  100%
Extracting archive /home/user/scratch/cget_test/cget/cget/build/tmp-9737299f14b44942b74e65ee781e74c4/armadillo-9.200.7.tar.xz ...
Unexpected error: <type 'exceptions.NameError'>
global name 'lzma' is not defined
Failed to build package .

Test case:

#!/bin/bash
virtualenv -p python2 venv &&
  source venv/bin/activate &&
  pip install cget &&
  echo 'armadillo,http://sourceforge.net/projects/arma/files/armadillo-9.200.7.tar.xz' >> requirements.txt &&
  cget install .

It seems to work just fine in a python 3 environment, however.

welchr avatar Feb 25 '19 20:02 welchr

Python 2 doesn't support lzma out of the box, but you can install backports.lzma(with pip install backports.lzma) to get support in python 2.

I should add a note about this in the installation section.

pfultz2 avatar Feb 27 '19 17:02 pfultz2