Solved: RHEL/CentOS: Could not import the lzma module. Your installed Python is incomplete.

In this post, we will see one of the common error message and its solution.

I. Error Message

/share/common/pkgs/python/v3.6.1/lib/python3.6/site-packages/pandas/compat/__init__.py:117: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
  File "pandas/_libs/parsers.pyx", line 2071, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 3, saw 2

 

II. Solution
The error is due to missing xz-devel package on the server.

We need to install this package to get rid of this message.

[root@ngelinux ~]# yum install xz-devel
Loaded plugins: aliases, changelog, fastestmirror, kabi, langpacks, tmprepo, verify, versionlock
Loading support for Red Hat kernel ABI
base                                                                                                    | 3.6 kB  00:00:00
centos-sclo-rh                                                                                          | 3.0 kB  00:00:00
centos-sclo-sclo                                                                                        | 3.0 kB  00:00:00
epel/x86_64/metalink                                                                                    |  27 kB  00:00:00
epel                                                                                                    | 4.7 kB  00:00:00
extras                                                                                                  | 2.9 kB  00:00:00
updates                                                                                                 | 2.9 kB  00:00:00
(1/6): epel/x86_64/group_gz                                                                             |  99 kB  00:00:00
(2/6): epel/x86_64/updateinfo                                                                           | 1.0 MB  00:00:00
(3/6): epel/x86_64/primary_db                                                                           | 7.0 MB  00:00:00
(4/6): extras/7/x86_64/primary_db                                                                       | 249 kB  00:00:00
(5/6): updates/7/x86_64/primary_db                                                                      |  19 MB  00:00:00
(6/6): centos-sclo-rh/x86_64/primary_db                                                                 | 3.4 MB  00:00:01
Determining fastest mirrors
 * base: mirror.arizona.edu
 * centos-sclo-rh: mirrors.raystedman.org
 * centos-sclo-sclo: mirrors.xmission.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirrors.xmission.com
 * updates: mirrors.sonic.net
Resolving Dependencies
--> Running transaction check
---> Package xz-devel.x86_64 0:5.2.2-1.el7 will be updated
---> Package xz-devel.i686 0:5.2.2-2.el7_9 will be installed
--> Processing Dependency: xz-libs = 5.2.2-2.el7_9 for package: xz-devel-5.2.2-2.el7_9.i686
---> Package xz-devel.x86_64 0:5.2.2-2.el7_9 will be an update
--> Running transaction check
---> Package xz-libs.i686 0:5.2.2-1.el7 will be updated
--> Processing Dependency: xz-libs = 5.2.2-1.el7 for package: xz-5.2.2-1.el7.x86_64
---> Package xz-libs.x86_64 0:5.2.2-1.el7 will be updated
---> Package xz-libs.i686 0:5.2.2-2.el7_9 will be an update
---> Package xz-libs.x86_64 0:5.2.2-2.el7_9 will be an update
--> Running transaction check
---> Package xz.x86_64 0:5.2.2-1.el7 will be updated
---> Package xz.x86_64 0:5.2.2-2.el7_9 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================
 Package                      Arch                       Version                             Repository                   Size
===============================================================================================================================
Installing:
 xz-devel                     i686                       5.2.2-2.el7_9                       updates                      46 k
Updating:
 xz-devel                     x86_64                     5.2.2-2.el7_9                       updates                      46 k
Updating for dependencies:
 xz                           x86_64                     5.2.2-2.el7_9                       updates                     229 k
 xz-libs                      i686                       5.2.2-2.el7_9                       updates                     109 k
 xz-libs                      x86_64                     5.2.2-2.el7_9                       updates                     103 k

Transaction Summary
===============================================================================================================================
Install  1 Package
Upgrade  1 Package (+3 Dependent packages)

Total download size: 534 k
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for updates
(1/5): xz-devel-5.2.2-2.el7_9.i686.rpm                                                                  |  46 kB  00:00:00
(2/5): xz-5.2.2-2.el7_9.x86_64.rpm                                                                      | 229 kB  00:00:00
(3/5): xz-devel-5.2.2-2.el7_9.x86_64.rpm                                                                |  46 kB  00:00:00
(4/5): xz-libs-5.2.2-2.el7_9.i686.rpm                                                                   | 109 kB  00:00:00
(5/5): xz-libs-5.2.2-2.el7_9.x86_64.rpm                                                                 | 103 kB  00:00:00
-------------------------------------------------------------------------------------------------------------------------------
Total                                                                                          2.2 MB/s | 534 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : xz-libs-5.2.2-2.el7_9.x86_64                                                                                1/9
  Updating   : xz-libs-5.2.2-2.el7_9.i686                                                                                  2/9
  Installing : xz-devel-5.2.2-2.el7_9.i686                                                                                 3/9
  Updating   : xz-devel-5.2.2-2.el7_9.x86_64                                                                               4/9
  Updating   : xz-5.2.2-2.el7_9.x86_64                                                                                     5/9
  Cleanup    : xz-devel-5.2.2-1.el7.x86_64                                                                                 6/9
  Cleanup    : xz-libs-5.2.2-1.el7                                                                                         7/9
  Cleanup    : xz-5.2.2-1.el7.x86_64                                                                                       8/9
  Cleanup    : xz-libs-5.2.2-1.el7                                                                                         9/9
  Verifying  : xz-devel-5.2.2-2.el7_9.i686                                                                                 1/9
  Verifying  : xz-libs-5.2.2-2.el7_9.i686                                                                                  2/9
  Verifying  : xz-devel-5.2.2-2.el7_9.x86_64                                                                               3/9
  Verifying  : xz-5.2.2-2.el7_9.x86_64                                                                                     4/9
  Verifying  : xz-libs-5.2.2-2.el7_9.x86_64                                                                                5/9
  Verifying  : xz-devel-5.2.2-1.el7.x86_64                                                                                 6/9
  Verifying  : xz-libs-5.2.2-1.el7.i686                                                                                    7/9
  Verifying  : xz-5.2.2-1.el7.x86_64                                                                                       8/9
  Verifying  : xz-libs-5.2.2-1.el7.x86_64                                                                                  9/9

Installed:
  xz-devel.i686 0:5.2.2-2.el7_9

Updated:
  xz-devel.x86_64 0:5.2.2-2.el7_9

Dependency Updated:
  xz.x86_64 0:5.2.2-2.el7_9              xz-libs.i686 0:5.2.2-2.el7_9              xz-libs.x86_64 0:5.2.2-2.el7_9

Complete!
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments