設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 386|回復: 0
打印 上一主題 下一主題

how to install Ta-lib with python 3.11 in Windows

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2023-4-6 09:04:59 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
The only solution that worked for me is this:  
[1]Download "ta-lib x64.zip" from github above. Extract zip file to C:\, so it looks like this C:\ta-lib
[2]Download Visual C++ build tools 2022:   https://aka.ms/vs/17/release/vs_buildtools.exe
[3]Install Visual C++ build tools: https://stackoverflow.com/a/54136652/10997732
[4]Install ta-lib: pip install ta-lib

You have to find the correct wheel file for TA-Lib and Python 3.11. I currently am trying to find the same file. 3.10 is the latest I have seen https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib

here’s exactly what installing ta-lib on my x64 computer looks like.

1)Get the library source from https://www.ta-lib.org/hdr_dw.html. Select the msvc version. As of this writing, the latest is 0.4.
2)Unzip the library so that c:\ta-lib has the readme.txt and the c, dotnet, etc directories. pip will look for this later.
3)Get build tools for Visual Studio: https://visualstudio.microsoft.c ... -visual-studio-2017
When launching the installer, select Individual Components and pick VC++2015.3 v14.00  (v140) toolset for desktop and Windows Universal CRT SDK. You’ll also need the Windows SDK. I installed the latest Windows 10 SDK, and the Windows 8.1 SDK.
4)Open a fresh command prompt (so that it has the new PATH environment with the build tools in it) and go to c:\ta-lib\c\make\cdr\win32\msvc
5)Execute “nmake”
6)pip install msgpack
7)%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 8.1
8)pip install TA-Lib

從命令列使用 Microsoft C++ 工具組 | Microsoft Learn
vcvarsall 語法
vcvarsall.bat [architecture] [platform_type] [winsdk_version] [-vcvars_ver=vcversion] [spectre_mode]
architecture
這個選擇性引數會指定要使用的主機和目標架構。 如果未指定 架構 ,則會使用預設建置環境。 支援的引數如下:
[td]
architecture
編譯器
主機電腦架構
組建輸出 (目標) 架構
x86x86 32 位元原生x86、x64x86
x86_amd64 或 x86_x64x64 on x86 (跨平台)x86、x64x64
x86_armARM on x86 (跨平台)x86、x64ARM
x86_arm64ARM64 on x86 (跨平台)x86、x64ARM64
amd64 或 x64x64 64 位元原生x64x64
amd64_x86 或 x64_x86x86 on x64 (跨平台)x64x86
amd64_arm 或 x64_armARM on x64 (跨平台)x64ARM
amd64_arm64 或 x64_arm64ARM64 on x64 (跨平台)x64ARM64

platform_type
這個選擇性引數可讓您指定 store 或 uwp 作為平臺類型。 根據預設,環境會設定為建置桌面或主控台應用程式。
winsdk_version
選擇性地指定要使用的 Windows SDK 版本。 根據預設,會使用最新安裝的 Windows SDK。 若要指定 Windows SDK 版本,您可以使用完整的 Windows SDK 號碼,例如 10.0.10240.0 ,或指定 8.1 以使用 Windows 8.1 SDK。
vcversion
選擇性地指定要使用的 Visual Studio 編譯器工具組。 根據預設,環境會設定為使用目前的 Visual Studio 編譯器工具組。
使用 -vcvars_ver=14.2x.yyyyyyy 來指定 Visual Studio 2019 編譯器工具組的特定版本。
使用 -vcvars_ver=14.29 來指定最新版的 Visual Studio 2019 編譯器工具組。

使用 -vcvars_ver=14.0 來指定 Visual Studio 2015 編譯器工具組。
spectre_mode
請將此參數保留為不使用 Spectre 風險降低的程式庫。 使用 值 spectre 搭配 Spectre 風險降低使用程式庫。
在現有的命令提示字元視窗中設定組建環境
  • 在命令提示字元中,使用 CD 命令切換至 Visual Studio 安裝目錄。 然後,再次使用 CD 變更至包含組態特定指令檔的子目錄。 針對 Visual Studio 2019 和 Visual Studio 2017,請使用 VC\Auxiliary\Build 子目錄。 針對 Visual Studio 2015,請使用 VC 子目錄。
  • 針對您慣用的開發人員環境輸入命令。 例如,若要在 64 位平臺上建置 UWP 的 ARM 程式碼,請使用最新的 Windows SDK 和 Visual Studio 編譯器工具組,請使用下列命令列:
    vcvarsall.bat amd64_arm uwp

建立您自己的命令提示字元捷徑
開啟開發人員命令提示字元快捷方式的 [屬性] 對話方塊,以查看所使用的命令目標。 例如,VS 2019 的 x64 Native Tools 命令提示字元捷徑的目標會類似於:
%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"

架構特定的批次檔會設定 architecture 參數並呼叫 vcvarsall.bat 。 您可以將相同的選項傳遞給這些批次檔,就像傳遞至 vcvarsall.bat 一樣,也可以直接呼叫 vcvarsall.bat 。 若要為您自己的命令捷徑指定參數,請將參數新增至命令結尾處,並以雙引號括住。 例如,以下是使用最新 Windows SDK 在 64 位平臺上建置 UWP ARM 程式碼的快捷方式。 若要使用先前的編譯器工具組,請指定版本號碼。 請在您的捷徑中使用如下的命令目標:
%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm uwp -vcvars_ver=14.29

調整路徑以反映 Visual Studio 安裝目錄。 Vcvarsall.bat 檔案含有關於特定版本號碼的其他資訊。


Install TA-Lib C Library on Windows 10
  • Download and Unzip [color=var(--color-accent-fg)]ta-lib-0.4.0-msvc.zip
  • Move the Unzipped Folder ta-lib to C:\
  • Download and Install Visual Studio Community 2015
  • Remember to Select [Visual C++] Feature
  • Build TA-Lib Library
  • From Windows Start Menu, Start [VS2015 x64 Native Tools Command Prompt]
  • Move to C:\ta-lib\c\make\cdr\win32\msvc
  • Build the Library nmake
  • Then pip3 install ta-lib
Installed Visual Studio Community and ran VS2015 x64 Native Tools Command Prompt
nmake worked and pip install worked.
Install TA-Lib C Library on Windows 10
  • [color=var(--color-accent-fg)]Download and Unzip ta-lib-0.4.0-msvc.zip
  • Move the Unzipped Folder ta-lib to C:\
  • Download and Install Visual Studio Community 2019
  • Remember to Select [Visual C++] Feature, tick the box 'desktop development with c++' under desktop/mobile section
  • Build TA-Lib Library
  • From Windows Start Menu, Start [x64 Native Tools Command Prompt for VS 2019]
  • Move to C:\ta-lib\c\make\cdr\win32\msvc
  • Build the Library nmake
  • Then python -m pip install TA-Lib
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-5-16 20:37 , Processed in 0.235200 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表