Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing the lzma lib?

Tags:

python

pip

lzma

The following message means that Python has not been installed completely. If Yes! Do I have to install the lzma extension?

ModuleNotFoundError: No module name '_lzma' <br/>
Warning: The Python lzma extension was not compiled. Missing the lzma lib? <br/>
Installed Python-3.11.3 to /Users/admin/.pyenv/versions/3.11.3

2 Answers

For Mac:

You need to install xz so that it finds the lzma module from the OS.

brew install readline xz

For Debian/Ubuntu:

sudo apt-get install liblzma-dev

For centos/redhat-based:

yum install -y xz-devel
like image 55
morhook Avatar answered Sep 02 '25 15:09

morhook


Per Chris' comment, the solution is to install OS-specific dependencies then use pyenv to install a python version.

like image 36
Doug Ayers Avatar answered Sep 02 '25 15:09

Doug Ayers