tsfresh 安装问题收集

在Linux Redhat系统上,使用Python2.7安装tsfresh库时,遇到了一系列依赖问题,包括安装python-devel、gcc、blas-devel、lapack-devel等。在安装numpy和SciPy过程中,需要解决RuntimeError、ImportError和UnicodeDecodeError。通过升级setuptools、创建sitecustomize.py文件以及安装缺失的开发组件,最终成功安装tsfresh。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

系统: linux redhat 

环境: python2.7

tsfresh官网:http://tsfresh.readthedocs.io/en/latest/text/quick_start.html

tsfresh本身官网提供的安装过程比较简单: pip install tsfresh即可。但是安装过程很耗时且安装过程中依赖的其他的python组件,一旦安装报错则只能重新安装,下面是自己的采坑之旅。

1、yum install python-devel 安装 python-devel。 该组件是安装numpy时依赖的组件

2、yum install gcc gcc+ gcc-c++, 安装gcc编译组件。 numpy+SciPy需要依赖这三个组件,已安装可以跳过

3、yum install blas-devel lapack-devel, SciPy组件依赖这两个开发组件。

4、pip install numpy  , 安装numpy

5、pip install SciPy , 安装SciPy

6、pip install -U setuptools 升级pip版本,否则tsfresh安装过程中会报错,提示升级版本

7、pip install 出现UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 73: ordinal not i错误信息时

     解决办法:
1)在/usr/local/lib/python2.7/site-packages目录下创建 sitecustomize.py
2)文件中输入: 
import sys
sys.setdefaultencoding('utf-8')

3)重新执行pip install 命令

8、pip install tsfresh, 安装过程中如果出现  read time out 等错误时,重新执行命令,下载包安装即可。



下面为安装过程中遇到问题总结:

python2.7   安装问题
 1、RuntimeError: Broken toolchain: cannot link a simple C program
解决办法:sudo pip install -U setuptools


2、ImportError: No module named numpy.distutils.misc_util
解决办法:pip install numpy


3、执行pip install numpy 时仍然报 RuntimeError: Broken toolchain: cannot link a simple C program
 解决办法:
1) 查看gcc是否安装: rpm -qa | grep gcc, 未安装则安装gcc ,安装命令 yum install gcc


4、执行 pip install numpy 报: SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
解决办法:安装 python-devel , yum install python-devel


5、ImportError: Scientific Python (SciPy) is not installed.
解决方案:sudo pip install SciPy


6、安装 SciPy时报 numpy.distutils.system_info.NotFoundError: no lapack/blas resources found 
sudo yum install blas-devel lapack-devel


7、pip install 出现UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 73: ordinal not i
解决办法:
1)在/usr/local/lib/python2.7/site-packages目录下创建 sitecustomize.py
2)文件中输入: 
import sys
sys.setdefaultencoding('utf-8')
3)重新执行pip install 命令

9、/bin/bash: g++: command not found
解决方案: 查看是否安装gcc, rpm -qa | grep gcc.  rpm -qa | grep gcc+ . rpm -qa | grep gcc-c++
没有进行安装,安装了则进行升级。
yum -y update gcc
yum -y install gcc+ gcc-c++


10、RuntimeError: Your setuptools version is too old (<12). Use `pip install -U setuptools` to upgrade.
pip install -U setuptools


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值