Carnets icon indicating copy to clipboard operation
Carnets copied to clipboard

%pip install backports.lzma || py7zr can’t be installed

Open bebopimpromptu opened this issue 3 years ago • 2 comments

When trying to install, starts but it says “Failed to build backports.lzma” and other case “Preparing metadata (pyproject.toml): finished with status 'error'”. After the error kernel starts to works odd, every time when re starting the kernel died and then starts again.

bebopimpromptu avatar Apr 11 '23 01:04 bebopimpromptu

It's a bit more difficult to debug without the full error message, but backports.lzma tries to compile the lzma library and the xz command. Both of these require a compiler (to compile C source code and libraries), which does not exist on iOS. Hence they cannot be installed (only pure Python packages can be installed). Same with py7zr. You can use a-Shell to have the xz utility.

That being said, lzma is supposed to be included with Python versions after 3.3, so backports.lzma should not be necessary. I'll investigate.

holzschu avatar Apr 11 '23 03:04 holzschu

If I had to guess, there's a pyproject.toml in some project, which is always installing backports.lzma even though it is only needed on Python 2 (and some fairly old Python 3.x versions). Ideally the pyproject.toml would conditionally (like 'backports.lzma; python_version<"3.3"'). Maybe worth asking that project if they would be open to this change?

jakirkham avatar Aug 06 '23 09:08 jakirkham