python 无法构建ta-lib错误:无法为ta-lib构建wheel,而ta-lib是安装基于pyproject. toml的项目所必需的

sr4lhrrt  于 2022-12-17  发布在  Python
关注(0)|答案(3)|浏览(1130)

当pip安装ta-lib时,我收到以下错误。我使用了命令:

!pip install ta-lib

请提供解决方案。

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting ta-lib
  Using cached TA-Lib-0.4.25.tar.gz (271 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (from ta-lib) (1.21.6)
Building wheels for collected packages: ta-lib
  error: subprocess-exited-with-error
  
  × Building wheel for ta-lib (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for ta-lib (pyproject.toml) ... error
  ERROR: Failed building wheel for ta-lib
Failed to build ta-lib
ERROR: Could not build wheels for ta-lib, which is required to install pyproject.toml-based projects

我尝试了以下命令:
一个二个二个一个一个三个一个一个一个四个一个一个一个一个五个一个一个一个一个一个六个一个一个一个一个七个一个

c9qzyr3d

c9qzyr3d1#

https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib 在此网站中下载ta-lib.whl,然后pip安装gotch

axkjgtzd

axkjgtzd2#

我花了几个小时在网上遵循非常糟糕的指导,这些指导要么写得很糟糕,遗漏了重要的细节,要么就是根本不起作用。我正准备写自己的帖子,讲述我遵循三个不同指南时遇到的问题,突然,我发现下面的代码行修复了一切.........我在Anaconda命令提示符中键入了(就像这样......这些都是简单但重要的细节,人们通常无法沟通)..... conda install -c conda-forge ta-lib
希望这也能保存别人的时间。

sirbozc5

sirbozc53#

有两种方法,尝试以下第一,它的工作原理谷歌Colab:
!curl -L http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz-O && tar xzvf ta-lib-0.4.0-src.tar.gz!cd ta-lib && ./配置--前缀=/usr && make && make安装&& cd - & pip安装ta-lib
祝你好运!

相关问题