XZ_5.1.2alpha not found solution in conda environment

1 Problem description

yum install cmake

Installing cmake using yum failed. The failure information is as follows:

 [root@localhost]# yum install cmake
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   /root/anaconda3/lib/liblzma.so.5: version `XZ_5.1.2alpha' not found (required by /lib64/librpmio.so.3)

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, Oct 14 2020, 14:45:30) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

2 Problem analysis

From the analysis of the following sentence, we can draw the conclusion

/root/anaconda3/lib/liblzma.so.5: version `XZ_5.1.2alpha' not found (required by /lib64/librpmio.so.3)

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, Oct 14 2020, 14:45:30) 

This problem is mainly caused by the conflict between yum and anaconda3. The python version in the yum environment is 2.7, while the version in the anaconda3 environment is 3.x.

3 problem solving

Delete the original soft link and create a new soft link pointing to the system lib library

cd $CONDA_PREFIX/lib
rm libcurl.so.4 libcurl.so liblzma.so.5 liblzma.so
ln -s /lib64/liblzma.so.5.2.2 liblzma.so.5
ln -s liblzma.so.5 liblzma.so
ln -s /lib64/libcurl.so.4.3.0 libcurl.so.4
ln -s libcurl.so.4 libcurl.so

Running the cmake installation command again displays the following:

yum install cmake
已加载插件:fastestmirror, langpacks, nvidia, priorities
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * centos-sclo-rh: mirrors.bfsu.edu.cn
 * centos-sclo-sclo: mirrors.bfsu.edu.cn
 * extras: mirrors.aliyun.com
 * nux-dextop: li.nux.ro
 * updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 cmake.x86_64.0.2.8.12.2-2.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

==========================================================================================================================================================================================
 Package                                   架构                                       版本                                                 源                                        大小
==========================================================================================================================================================================================
正在安装:
 cmake                                     x86_64                                     2.8.12.2-2.el7                                       base                                     7.1 M

事务概要
==========================================================================================================================================================================================
安装  1 软件包

总下载量:7.1 M
安装大小:27 M
Is this ok [y/d/N]: y
Downloading packages:
cmake-2.8.12.2-2.el7.x86_64.rpm                                                                                                                                    | 7.1 MB  00:00:06     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : cmake-2.8.12.2-2.el7.x86_64                                                                                                                                           1/1 
  验证中      : cmake-2.8.12.2-2.el7.x86_64                                                                                                                                           1/1 

已安装:
  cmake.x86_64 0:2.8.12.2-2.el7                                                                                                                                                           

完毕!

The final installation was successful and the problem was solved!

Guess you like

Origin blog.csdn.net/lsb2002/article/details/133157839