安装TA-Lib-Precompiled时遇Cython内部编译错误'_common.pxi' not found的解决求助
各位好,我在PyCharm中运行Python程序时,卡在了TA-Lib-Precompiled包的安装环节,一直报编译失败的错误,导致程序完全无法启动,麻烦大家帮忙看看该怎么解决这个问题!
我的环境信息
- 目标安装包:TA-Lib-Precompiled
- Python版本:3.12.1
- Cython版本:3.0.11
核心错误提示
ERROR: Failed building wheel for TA-Lib-Precompiled ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (TA-Lib-Precompiled)
完整安装日志
Collecting TA-Lib-Precompiled
Using cached TA-Lib-Precompiled-0.4.25.tar.gz (276 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: numpy in c:\python312\lib\site-packages (from TA-Lib-Precompiled) (1.26.4)
Building wheels for collected packages: TA-Lib-Precompiled
Building wheel for TA-Lib-Precompiled (setup.py): started
Building wheel for TA-Lib-Precompiled (setup.py): finished with status 'error'
Running setup.py clean for TA-Lib-Precompiled
Failed to build TA-Lib-Precompiled
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Cython\\Utils.py", line 129, in Cython.Utils.cached_method.wrapper File "C:\Python312\Lib\site-packages\Cython\Build\Dependencies.py", line 574, in cimports_externs_incdirs for include in self.included_files(filename): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Cython\\Utils.py", line 129, in Cython.Utils.cached_method.wrapper File "C:\Python312\Lib\site-packages\Cython\Build\Dependencies.py", line 556, in included_files include_path = self.context.find_include_file(include, source_file_path=filename) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\Cython\Compiler\Main.py", line 299, in find_include_file error(pos, "'%s' not found" % filename) File "C:\Python312\Lib\site-packages\Cython\Compiler\Errors.py", line 178, in error raise InternalError(message)
Cython.Compiler.Errors.InternalError: Internal compiler error: '_common.pxi' not found
[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-Precompiled
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (TA-Lib-Precompiled)
备注:内容来源于stack exchange,提问作者Vineet Tripathi

