Error in installing backups.lzma for Python on Linux
pip3.9 install backports.lzma
Error Message:
Running setup.py install for backports.lzma … error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.9 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘”’”’/tmp/pip-install-pnrkhuf9/backports-lzma_24feded447a34e5a8b1c53cb80e10341/setup.py’”’”’; file=’”’”’/tmp/pip-install-pnrkhuf9/backports-lzma_24feded447a34e5a8b1c53cb80e10341/setup.py’”’”’;f = getattr(tokenize, ‘”’”‘open’”’”’, open)(file) if os.path.exists(file) else io.StringIO(’”’”‘from setuptools import setup; setup()’”’”’);code = f.read().replace(’”’”’\r\n’”’”’, ‘”’”’\n’”’”’);f.close();exec(compile(code, file, ‘”’”‘exec’”’”’))’ install –record /tmp/pip-record-tcqknwy3/install-record.txt –single-version-externally-managed –compile –install-headers /usr/local/python3.9/include/python3.9/backports.lzma
cwd: /tmp/pip-install-pnrkhuf9/backports-lzma_24feded447a34e5a8b1c53cb80e10341/
Complete output (21 lines):
This is backports.lzma version 0.0.14
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/backports
copying backports/init.py -> build/lib.linux-x86_64-3.9/backports
creating build/lib.linux-x86_64-3.9/backports/lzma
copying backports/lzma/init.py -> build/lib.linux-x86_64-3.9/backports/lzma
running build_ext
building ‘backports.lzma._lzma’ extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/backports
creating build/temp.linux-x86_64-3.9/backports/lzma
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/python3.9/include -I/root/include -I/opt/local/include -I/usr/local/include -I/usr/local/python3.9/include/python3.9 -c backports/lzma/_lzmamodule.c -o build/temp.linux-x86_64-3.9/backports/lzma/_lzmamodule.o
backports/lzma/_lzmamodule.c:115:10: fatal error: lzma.h: No such file or directory
#include <lzma.h>
^~~~~~~~
compilation terminated.
error: command ‘/usr/bin/gcc’ failed with exit code 1
—————————————-
ERROR: Command errored out with exit status 1: /usr/bin/python3.9 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘”’”’/tmp/pip-install-pnrkhuf9/backports-lzma_24feded447a34e5a8b1c53cb80e10341/setup.py’”’”’; file=’”’”’/tmp/pip-install-pnrkhuf9/backports-lzma_24feded447a34e5a8b1c53cb80e10341/setup.py’”’”’;f = getattr(tokenize, ‘”’”‘open’”’”’, open)(file) if os.path.exists(file) else io.StringIO(’”’”‘from setuptools import setup; setup()’”’”’);code = f.read().replace(’”’”’\r\n’”’”’, ‘”’”’\n’”’”’);f.close();exec(compile(code, file, ‘”’”‘exec’”’”’))’ install –record /tmp/pip-record-tcqknwy3/install-record.txt –single-version-externally-managed –compile –install-headers /usr/local/python3.9/include/python3.9/backports.lzma Check the logs for full command output.
Solution:
apt install -y liblzma-dev #ubuntu
yum install -y xz-devel #centos
At this point, there is no problem when executing pip3.9 install backups.lzma
Read More:
- Solutions to errors in installing xunsearch engine in centos8.0
- When installing software in Ubuntu, it prompts: E: You don’t have enough free space in /var/cache/apt/archives/.
- [Solved] Linux — 9 — txt files are copied from windows to Linux and read error
- Error in Linux running file: bash: $’\r’: command not found
- [Solved] websocket error in Linux service: / lib64 / libc. So. 6: version ` glibc_2.17‘ not found
- How to Create Threads in Linux
- mysqlclient in Ubuntu: How to Solve mysqlclient Install Error
- Installation and configuration of redis in Linux
- Chinese garbled problem when running. C file in Linux
- [Solved] Go use zoom to connect DM database and start reporting error in Linux
- Parse error in ubantu/Linux system [How to Solve]
- [Solved] Linux – error: cannot open Packages database in /var/lib/rpm
- How to Fix No default.conf file in conf.d after Installing Nginx
- Restart and stop of nginx in Linux service
- The problem of inconsistent host names in building rabbitmq on Linux
- [Solved] Linux Error: mipsel-linux-gcc: fatal error: no input files
- Grep: How to Find All the Files Containing a String in Linux
- [Solved] Linux Compile Error: error: ‘for’ loop initial declarations are only allowed in C99 mode
- Linux Nagios failed to log in to internal server error (Fixed)
- Linux Error: CMake Error in CMakeLists.txt: No CMAKE_CXX_COMPILER could be found.