Error handling during Python project running process

1. Background

Insert image description here

Due to the recent localization transformation of the OS, the Python project in the centos 6.5 environment needs to be migrated to the BCLinux 8.6 environment to run. However, there are some errors during the running process. They are recorded here for reference by latecomers.

Live environment: Python3.6.3----->Target: python3.6.8

Resource links: backports-lzma , PyPI Tsinghua mirror , campus pypi source , stackoverflow , Python Package Index

2. Error handling:

1)报错:pandas/compat/init.py:85: UserWarning: Could not import the lzma module.

Insert image description here
This is because the migrated environment lacks dependencies and the backports.lzma module. Execute:

yum install python-backports-lzma xz-devel gcc -y
Wget https://files.pythonhosted.org/packages/21/0f/1a9990233076d48aa2084100ba289ca162975e73a688f3a56c0ee2bb441a/backports.lzma-0.0.14.tar.gz
tar -xzf backports.lzma-0.0.14.tar.gz 
python3 setup.py install  #依赖gcc,输出如下
……
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.t

Guess you like

Origin blog.csdn.net/ximenjianxue/article/details/132877273