Failed building wheel for TA-Lib in VS Code without Anaconda on Windows 10

huangapple go评论124阅读模式
英文:

Failed building wheel for TA-Lib in VS Code without Anaconda on Windows 10

问题

I'm trying to install TA-Lib in VS Code without conda.
In a new terminal VSC and venv I execute:
(trading) D:\CWD>python -m pip install TA-Lib
and getting the output:

  1. Collecting TA-Lib
  2. Using cached TA-Lib-0.4.26.tar.gz (272 kB)
  3. Installing build dependencies ... done
  4. Getting requirements to build wheel ... done
  5. Installing backend dependencies ... done
  6. Preparing metadata (pyproject.toml) ... done
  7. Collecting numpy (from TA-Lib)
  8. Using cached numpy-1.25.0-cp310-cp310-win_amd64.whl (15.0 MB)
  9. Building wheels for collected packages: TA-Lib
  10. Building wheel for TA-Lib (pyproject.toml) ... error
  11. error: subprocess-exited-with-error
  12. × Building wheel for TA-Lib (pyproject.toml) did not run successfully.
  13. exit code: 1
  14. ╰─> [20 lines of output]
  15. <string>:77: UserWarning: Cannot find ta-lib library, installation may fail.
  16. running bdist_wheel
  17. running build
  18. running build_py
  19. creating build
  20. creating build\lib.win-amd64-cpython-310
  21. creating build\lib.win-amd64-cpython-310\talib
  22. copying talib\abstract.py -> build\lib.win-amd64-cpython-310\talib
  23. copying talib\deprecated.py -> build\lib.win-amd64-cpython-310\talib
  24. copying talib\stream.py -> build\lib.win-amd64-cpython-310\talib
  25. copying talib\test_abstract.py -> build\lib.win-amd64-cpython-310\talib
  26. copying talib\test_data.py -> build\lib.win-amd64-cpython-310\talib
  27. copying talib\test_func.py -> build\lib.win-amd64-cpython-310\talib
  28. copying talib\test_pandas.py -> build\lib.win-amd64-cpython-310\talib
  29. copying talib\test_polars.py -> build\lib.win-amd64-cpython-310\talib
  30. copying talib\test_stream.py -> build\lib.win-amd64-cpython-310\talib
  31. copying talib\__init__.py -> build\lib.win-amd64-cpython-310\talib
  32. running build_ext
  33. building 'talib._ta_lib' extension
  34. error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  35. [end of output]
  36. note: This error originates from a subprocess, and is likely not a problem with pip.
  37. ERROR: Failed building wheel for TA-Lib
  38. Failed to build TA-Lib
  39. ERROR: Could not build wheels for TA-Lib, which is required to install pyproject.toml-based projects
  40. Remarks: 1) It's not a problem to install talib with conda. 2) I downloaded required MS C++ package as required. It's seen in Control panel. But probably some settings required for VSC in order to see it. Looks like it's the key point of the problem.
  41. Question: How to build wheels for TA-Lib without conda and install the TA-Lib?
  42. <details>
  43. <summary>英文:</summary>
  44. I&#39;m trying to install TA-Lib in VS Code without conda.
  45. In a new terminal VSC and venv I execute:
  46. `(trading) D:\CWD&gt;python -m pip install TA-Lib
  47. `
  48. and getting the output:

Collecting TA-Lib
Using cached TA-Lib-0.4.26.tar.gz (272 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting numpy (from TA-Lib)
Using cached numpy-1.25.0-cp310-cp310-win_amd64.whl (15.0 MB)
Building wheels for collected packages: TA-Lib
Building wheel for TA-Lib (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for TA-Lib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
<string>:77: UserWarning: Cannot find ta-lib library, installation may fail.
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\talib
copying talib\abstract.py -> build\lib.win-amd64-cpython-310\talib
copying talib\deprecated.py -> build\lib.win-amd64-cpython-310\talib
copying talib\stream.py -> build\lib.win-amd64-cpython-310\talib
copying talib\test_abstract.py -> build\lib.win-amd64-cpython-310\talib
copying talib\test_data.py -> build\lib.win-amd64-cpython-310\talib
copying talib\test_func.py -> build\lib.win-amd64-cpython-310\talib
copying talib\test_pandas.py -> build\lib.win-amd64-cpython-310\talib
copying talib\test_polars.py -> build\lib.win-amd64-cpython-310\talib
copying talib\test_stream.py -> build\lib.win-amd64-cpython-310\talib
copying talib_init_.py -> build\lib.win-amd64-cpython-310\talib
running build_ext
building 'talib._ta_lib' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
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

  1. Remarks: 1) It&#39;s not a problem to install talib with conda. 2) I downloaded required MS C++ package as required. It&#39;s seen in Control panel. But probably some settings required for VSC in order to see it. Looks like it&#39;s the key point of the problem.
  2. Question: How to build wheels for TA-Lib without conda and install the TA-Lib?
  3. </details>
  4. # 答案1
  5. **得分**: 0
  6. 问题的根本在于已安装的visual-cpp-build-tools
  7. 我进行了许多实验和调查,包括msbuild。我几乎达到了目标。
  8. 然后我发现了一个带有预编译wheels的网站。 =&gt;
  9. [&quot;https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib&quot;][1]
  10. 来自文章:
  11. [&quot;https://blog.quantinsti.com/install-ta-lib-python/&quot;][2]
  12. 所以,从在VS Code中激活的venv中,最终解决方案的语法:
  13. pip install TA_Lib-0.4.24-cp310-cp310-win_amd64.whl
  14. 请注意,文件名与上述网站中提到的Python和操作系统版本相对应。
  15. 它有效!
  16. <details>
  17. <summary>英文:</summary>
  18. The root of the problem is in the installed visual-cpp-build-tools.
  19. Ive made a lot of experiments and investigations, including msbuild. I almost reached the goal.
  20. Then I discovered the site with precompiled wheels. =&gt;
  21. [&quot;https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib&quot;][1]
  22. from the article:
  23. [&quot;https://blog.quantinsti.com/install-ta-lib-python/&quot;][2]
  24. So, from activated venv in VS Code,the syntax of final solution:
  25. pip install TA_Lib-0.4.24-cp310-cp310-win_amd64.whl
  26. Notice that the file name corresponds to your python and OS versions from the mentioned above site.
  27. It works!
  28. [1]: https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
  29. [2]: https://blog.quantinsti.com/install-ta-lib-python/
  30. </details>

huangapple
  • 本文由 发表于 2023年6月29日 14:11:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76578447.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定