Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
disonwei opened this issue Mar 18, 2023 · 6 comments
Open

Comments

@disonwei
Copy link

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?

@rolandcrosby
Copy link

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.

@whee
Copy link

whee commented Mar 23, 2023

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.

@cj-wong
Copy link

cj-wong commented Mar 24, 2023

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.

@andrewcrook
Copy link

andrewcrook commented Nov 4, 2023

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.

@Haelle
Copy link

Haelle commented Dec 20, 2023

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 ?

@andrewcrook
Copy link

andrewcrook commented Dec 20, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants