asdf-python icon indicating copy to clipboard operation
asdf-python copied to clipboard

WARNING: The Python lzma extension was not compiled. Missing the lzma lib?

Open disonwei opened this issue 1 year ago • 6 comments

Apple M2 13.2.1 Try installing python 3.11.2 3.11.1 3.10.10 After installing python, it will appear that lzma is not installed. Cause scrapy to fail to function properly

Downloading Python-3.10.10.tar.xz... -> https://www.python.org/ftp/python/3.10.10/Python-3.10.10.tar.xz Installing Python-3.10.10... python-build: use readline from homebrew python-build: use zlib from xcode sdk Traceback (most recent call last): File "", line 1, in File "/Users/dison/.asdf/installs/python/3.10.10/lib/python3.10/lzma.py", line 27, in from _lzma import * ModuleNotFoundError: No module named '_lzma' WARNING: The Python lzma extension was not compiled. Missing the lzma lib?

disonwei avatar Mar 18 '23 14:03 disonwei

I ran into this as well, but was able to solve it by reinstalling Python after installing xz via Homebrew. Not sure what to do if you're not using Homebrew.

rolandcrosby avatar Mar 22 '23 21:03 rolandcrosby

I'm seeing the same issue, but I primarily manage packages with Nix via nix-darwin; no Homebrew installed. I added the xz package via Nix but asdf doesn't seem to know where it is.

whee avatar Mar 23 '23 23:03 whee

For Linux (tested with Ubuntu 22.04), you need the following dependencies for asdf-python: libsqlite3-dev libbz2-dev liblzma-dev libffi-dev

I think some form of tkinter or tcl is also required if you develop GUI apps.

cj-wong avatar Mar 24 '23 08:03 cj-wong

On Mac Homebrew provides xz this is a newer algorithm implementation which has lzma backward compatibility. xz on Linux, NixOs and nix-darwin should also do the same.

Also on Mac libffi installation seems to be only required for very old versions of python , newer versions seem to have patches applied around ctypes by python-build which is used under pyenv which inturn is used by asdf-paython.

andrewcrook avatar Nov 04 '23 15:11 andrewcrook

For Linux (tested with Ubuntu 22.04), you need the following dependencies for asdf-python: libsqlite3-dev libbz2-dev liblzma-dev libffi-dev

I think some form of tkinter or tcl is also required if you develop GUI apps.

on a brand new computer (ubuntu 22) I forgot what dependencies I needed for Python via ASDF, it would be nice to have it in the README wdyt ?

Haelle avatar Dec 20 '23 10:12 Haelle

it would be nice to have it in the README

There is a link in README.md with a link to system build dependencies which covers the various requirements for platforms.

andrewcrook avatar Dec 20 '23 11:12 andrewcrook