简体   繁体   English

在anaconda中安装talib

[英]installation of talib in anaconda

I have a problem when trying to install ta-lib in the command prompt and got the following message in it.尝试在命令提示符下安装 ta-lib 时遇到问题,并收到以下消息。 Any idea to solve the issue?有解决问题的想法吗?

(base) C:\Users\LEGION>conda install -c quantopian ta-lib

Collecting package metadata (current_repodata.json): done Solving environment: / The environment is inconsistent, please check the package plan carefully The following packages are causing the inconsistency:正在收集包元数据(current_repodata.json):done 解决环境:/ 环境不一致,请仔细检查包计划以下包导致不一致:

  • defaults/win-64::anaconda==2019.07=py37_0默认/win-64::anaconda==2019.07=py37_0
    • defaults/win-64::numba==0.44.1=py37hf9181ef_0 failed with initial frozen solve. defaults/win-64::numba==0.44.1=py37hf9181ef_0 初始冻结解决失败。 Retrying with flexible solve.重试灵活解决。 Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.解决环境:使用 current_repodata.json 中的 repodata 失败,将使用下一个 repodata 源重试。 Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve.收集包元数据(repodata.json):完成解决环境:初始冻结解决失败。 Retrying with flexible solve.重试灵活解决。 Solving environment: - Found conflicts.解决环境: - 发现冲突。 Looking for incompatible packages.寻找不兼容的包。 This can take several minutes.这可能需要几分钟时间。 Press CTRL-C to abort.按 CTRL-C 中止。 failed失败的

UnsatisfiableError: The following specifications were found \ to be incompatible with the existing python installation in your environment: UnsatisfiableError:发现以下规范与您环境中现有的 python 安装不兼容:

Specifications:规格:

  • ta-lib -> python[version='2.7. ta-lib -> python[version='2.7. |3.5. |3.5。 |>=3.5,<3.6.0a0'] |>=3.5,<3.6.0a0']
  • ta-lib -> python[version='>=2.7,<2.8.0a0'] ta-lib -> python[version='>=2.7,<2.8.0a0']

Your python: python=3.7你的蟒蛇:蟒蛇= 3.7

If python is on the left-most side of the chain, that's the version you've asked for.如果 python 位于链的最左侧,那就是您要求的版本。 When python appears to the right, that indicates that the thing on the left is somehow not available for the python version you are constrained to.当 python 出现在右边时,这表明左边的东西在某种程度上不适用于您被限制的 python 版本。 Note that conda will not change your python version to a different minor version unless you explicitly specify that.请注意,除非您明确指定,否则 conda 不会将您的 python 版本更改为不同的次要版本。

The following specifications were found to be incompatible with each other:发现以下规范相互不兼容:

Package msgpack-python conflicts for:包 msgpack-python 冲突:

ta-lib -> python=2.7 -> pip -> cachecontrol -> msgpack-python Package ca-certificates conflicts for: ta-lib -> python=2.7 -> ca-certificates python=3.7 -> openssl[version='>=1.1.1a,<1.1.2a'] -> ca-certificates Package pip conflicts for: ta-lib -> python=2.7 -> pip python=3.7 -> pip Package setuptools conflicts for: python=3.7 -> pip -> setuptools ta-lib -> python=2.7 -> pip -> setuptools Package certifi conflicts for: python=3.7 -> pip -> setuptools -> certifi[version='>=2016.09|>=2016.9.26'] ta-lib -> python=2.7 -> pip -> setuptools -> certifi[version='>=2016.09|>=2016.9.26|>=2017.4.17'] Package wheel conflicts for: python=3.7 -> pip -> wheel ta-lib -> python=2.7 -> pip -> wheel Package wincertstore conflicts for: python=3.7 -> pip -> setuptools -> wincertstore[version='>=0.2'] ta-lib -> python=2.7 -> pip -> setuptools -> wincertstore[version='>=0.2'] ta-lib -> python=2.7 -> pip -> cachecontrol -> msgpack-python Package ca-certificates conflicts for: ta-lib -> python=2.7 -> ca-certificates python=3.7 -> openssl[version='> =1.1.1a,<1.1.2a'] -> ca-certificates Package pip conflicts for: ta-lib -> python=2.7 -> pip python=3.7 -> pip Package setuptools conflicts for: python=3.7 -> pip - > setuptools ta-lib -> python=2.7 -> pip -> setuptools Package certifi conflicts for: python=3.7 -> pip -> setuptools -> certifi[version='>=2016.09|>=2016.9.26'] ta- lib -> python=2.7 -> pip -> setuptools -> certifi[version='>=2016.09|>=2016.9.26|>=2017.4.17'] 包轮冲突:python=3.7 -> pip -> wheel ta-lib -> python=2.7 -> pip -> wheel 包 wincertstore 冲突:python=3.7 -> pip -> setuptools -> wincertstore[version='>=0.2'] ta-lib -> python=2.7 -> pip -> setuptools -> wincertstore[version='>=0.2']

I have tried the following ones but no one works for me: I am using ANACONDA我尝试了以下方法,但没有人适合我:我正在使用 ANACONDA

conda install TA-Lib
pip install TA-Lib

If you are using Anaconda, then you can try:如果您使用的是 Anaconda,那么您可以尝试:

conda install -c conda-forge ta-lib

That worked for me on 64-bit Windows.这在 64 位 Windows 上对我有用。

The following works for Windows 7 and 10:以下适用于 Windows 7 和 10:

  1. Check the Python version you have installed by running the command in your Anaconda Prompt:通过在 Anaconda Prompt 中运行以下命令来检查已安装的 Python 版本:

    python –version python –版本

  2. Check your Windows System architecture by right clicking and selecting Properties on the This PC or My Computer on File Explorer (My Python version is 3.7 and System type is 64-bit Operating System so I downloaded TA_Lib-0.4.18-cp37-cp37m-win_amd64.whl where cp37 is the Python version and amd64 is the Windows Operating System).通过右键单击并在文件资源管理器的“这台电脑”或“我的电脑”上选择“属性”来检查您的 Windows 系统架构(我的 Python 版本是 3.7,系统类型是 64 位操作系统,所以我下载了 TA_Lib-0.4.18-cp37-cp37m-win_amd64 .whl 其中 cp37 是 Python 版本,amd64 是 Windows 操作系统)。

enter image description here在此处输入图像描述

enter image description here在此处输入图像描述

  1. Move this file to where you have your Python installed and run the following command in Anaconda Prompt:将此文件移动到您安装 Python 的位置,并在 Anaconda Prompt 中运行以下命令:

    pip install TA_Lib-0.4.18-cp37-cp37m-win_amd64.whl pip 安装 TA_Lib-0.4.18-cp37-cp37m-win_amd64.whl

- Source -来源

After many hours trying different things.经过几个小时尝试不同的事情。 I had to use the following unofficial recipe which was created specifically for Windows 10:我不得不使用以下专门为 Windows 10 创建的非官方配方

conda install -c masdeseiscaracteres ta-lib

Testing:测试:

Install nose
pip install nose
Run tests
nosetests -v talib

If everything goes alright, the following is expected:如果一切顺利,预计会出现以下情况:

talib.test_abstract.test_pandas ... ok
talib.test_abstract.test_SMA ... ok
talib.test_abstract.test_STOCH ... ok
talib.test_abstract.test_doji_candle ... ok
talib.test_abstract.test_MAVP ... ok
talib.test_abstract.test_info ... ok
talib.test_abstract.test_input_names ... ok
talib.test_abstract.test_input_arrays ... ok
talib.test_abstract.test_parameters ... ok
talib.test_abstract.test_lookback ... ok
talib.test_func.test_talib_version ... ok
talib.test_func.test_num_functions ... ok
talib.test_func.test_input_lengths ... ok
talib.test_func.test_input_nans ... ok
talib.test_func.test_unstable_period ... ok
talib.test_func.test_MIN ... ok
talib.test_func.test_MAX ... ok
talib.test_func.test_MOM ... ok
talib.test_func.test_BBANDS ... ok
talib.test_func.test_DEMA ... ok
talib.test_func.test_EMAEMA ... ok
talib.test_func.test_CDL3BLACKCROWS ... ok
talib.test_func.test_RSI ... ok
talib.test_func.test_MAVP ... ok
talib.test_stream.test_streaming ... ok
talib.test_stream.test_CDL3BLACKCROWS ... ok

----------------------------------------------------------------------
Ran 26 tests in 0.131s

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM