Missing the lzma lib?

10.1k Views Asked by At

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'
Warning: The Python lzma extension was not compiled. Missing the lzma lib?
Installed Python-3.11.3 to /Users/admin/.pyenv/versions/3.11.3

Thank you!

2

There are 2 best solutions below

0
Doug Ayers On BEST ANSWER

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

0
morhook On

For Mac:

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

brew install readline xz

For ubuntu:

sudo apt-get install liblzma-dev

For centos:

yum install -y xz-devel