栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Python3.x UserWarning: Could not import the lzma module. Your installed Python is incomplete

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Python3.x UserWarning: Could not import the lzma module. Your installed Python is incomplete

问题描述: 系统为:CentOS Linux release 8.2.2004 (Core) 执行Python脚本的时候出现:

UserWarning: Could not import the lzma module. Your installed Python is incomplete
python3安装pandas库出现: Could not import the lzma module

刚开始的时候浪费了很长时间,有的网上大哥出招说:进入/usr/local/python3/lib/python3.7目录下,
编辑lzma.py 巴拉巴拉什么的,根本都不管用,依然报错,而且这样的文章抄来抄去不在少数,都不解决问题。

根本解决办法如下:

解决办法: 依次执行如下命令:

  1. sudo yum install -y xz-devel
  2. cd Python-3.8.5
  3. sudo ./configure --prefix=/usr/local/python3.8.5 --enable-optimizations --with-ssl
  4. sudo make
  5. sudo make install

再次运行python脚本,问题得到解决。

=======================================================

If your OS is Ubuntu 18.04, you can run the command below:

sudo apt-get install lzma

Then run in the python source code folder:

sudo apt-get install liblzma-dev
sudo apt-get install lzma
./configure --enable-optimizations
sudo make
sudo make altinstall

参考文献:https://stackoverflow.com/questions/57743230/userwarning-could-not-import-the-lzma-module-your-installed-python-is-incomple/

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/307300.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号