当前位置:   article > 正文

python运行文件报错:UserWarning: Could not import the lzma module. Your installed Python is incomplete.

userwarning: could not import the lzma module. your installed python is inco

[root@10-9-88-115 project]# python test.py
/usr/local/python3/lib/python3.7/site-packages/pandas/compat/__init__.py:124: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
  warnings.warn(msg)

 解决办法:

一, 在LINUX安装支持包

  1. yum install xz-devel
  2. yum install python-backports-lzma
  3. pip install backports.lzma

二,进入lzma配置文件 cd /usr/local/python3/lib/python3.7/  ,运行 vi lzma.py
        修改一下( 加入try : except )

  1. try:
  2. from _lzma import *
  3. from _lzma import _encode_filter_properties, _decode_filter_properties
  4. except ImportError:
  5. from backports.lzma import *
  6. from backports.lzma import _encode_filter_properties, _decode_filter_properties

完成!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/904121
推荐阅读
相关标签
  

闽ICP备14008679号