'tag.htm'; break; case 'flag': $pre .= $default_pre .= 'flag.htm'; break; case 'my': $pre .= $default_pre .= 'my.htm'; break; case 'my_password': $pre .= $default_pre .= 'my_password.htm'; break; case 'my_bind': $pre .= $default_pre .= 'my_bind.htm'; break; case 'my_avatar': $pre .= $default_pre .= 'my_avatar.htm'; break; case 'home_article': $pre .= $default_pre .= 'home_article.htm'; break; case 'home_comment': $pre .= $default_pre .= 'home_comment.htm'; break; case 'user': $pre .= $default_pre .= 'user.htm'; break; case 'user_login': $pre .= $default_pre .= 'user_login.htm'; break; case 'user_create': $pre .= $default_pre .= 'user_create.htm'; break; case 'user_resetpw': $pre .= $default_pre .= 'user_resetpw.htm'; break; case 'user_resetpw_complete': $pre .= $default_pre .= 'user_resetpw_complete.htm'; break; case 'user_comment': $pre .= $default_pre .= 'user_comment.htm'; break; case 'single_page': $pre .= $default_pre .= 'single_page.htm'; break; case 'search': $pre .= $default_pre .= 'search.htm'; break; case 'operate_sticky': $pre .= $default_pre .= 'operate_sticky.htm'; break; case 'operate_close': $pre .= $default_pre .= 'operate_close.htm'; break; case 'operate_delete': $pre .= $default_pre .= 'operate_delete.htm'; break; case 'operate_move': $pre .= $default_pre .= 'operate_move.htm'; break; case '404': $pre .= $default_pre .= '404.htm'; break; case 'read_404': $pre .= $default_pre .= 'read_404.htm'; break; case 'list_404': $pre .= $default_pre .= 'list_404.htm'; break; default: $pre .= $default_pre .= theme_mode_pre(); break; } if ($config['theme']) { $conffile = APP_PATH . 'view/template/' . $config['theme'] . '/conf.json'; $json = is_file($conffile) ? xn_json_decode(file_get_contents($conffile)) : array(); } !empty($json['installed']) and $path_file = APP_PATH . 'view/template/' . $config['theme'] . '/htm/' . ($id ? $id . '_' : '') . $pre; (empty($path_file) || !is_file($path_file)) and $path_file = APP_PATH . 'view/template/' . $config['theme'] . '/htm/' . $pre; if (!empty($config['theme_child']) && is_array($config['theme_child'])) { foreach ($config['theme_child'] as $theme) { if (empty($theme) || is_array($theme)) continue; $path_file = APP_PATH . 'view/template/' . $theme . '/htm/' . ($id ? $id . '_' : '') . $pre; !is_file($path_file) and $path_file = APP_PATH . 'view/template/' . $theme . '/htm/' . $pre; } } !is_file($path_file) and $path_file = APP_PATH . ($dir ? 'plugin/' . $dir . '/view/htm/' : 'view/htm/') . $default_pre; return $path_file; } function theme_mode_pre($type = 0) { global $config; $mode = $config['setting']['website_mode']; $pre = ''; if (1 == $mode) { $pre .= 2 == $type ? 'portal_category.htm' : 'portal.htm'; } elseif (2 == $mode) { $pre .= 2 == $type ? 'flat_category.htm' : 'flat.htm'; } else { $pre .= 2 == $type ? 'index_category.htm' : 'index.htm'; } return $pre; } ?>python - Error Installing TA-Lib on Google Colab After Recent Update: Failed Building Wheel - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Error Installing TA-Lib on Google Colab After Recent Update: Failed Building Wheel - Stack Overflow

programmeradmin31浏览0评论

I encountered an issue while trying to install the TA-Lib library on Google Colab after its recent update. Previously, I was able to install it using the following commands:

!wget .4.0-src.tar.gz
!tar -xzf ta-lib-0.4.0-src.tar.gz
%cd ta-lib
!./configure --prefix=/usr
!make
!sudo make install
!pip install TA-Lib==0.4.19

However, when I run this code now, I receive the following error:

Using pip 24.1.2 from /usr/local/lib/python3.11/dist-packages/pip (python 3.11)
Collecting TA-Lib==0.4.19
  Using cached TA-Lib-0.4.19.tar.gz (267 kB)
  Running command python setup.py egg_info
  /usr/local/lib/python3.11/dist-packages/setuptools/__init__.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
  !!

          ********************************************************************************
          Requirements should be satisfied by a PEP 517 installer.
          If you are using pip, you can try `pip install --use-pep517`.
          ********************************************************************************

  !!
    dist.fetch_build_eggs(dist.setup_requires)
  running egg_info
  creating /tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info
  writing /tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file '/tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /usr/local/lib/python3.11/dist-packages (from TA-Lib==0.4.19) (1.26.4)
Building wheels for collected packages: TA-Lib
  Running command python setup.py bdist_wheel
  /usr/local/lib/python3.11/dist-packages/setuptools/__init__.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
  !!

          ********************************************************************************
          Requirements should be satisfied by a PEP 517 installer.
          If you are using pip, you can try `pip install --use-pep517`.
          ********************************************************************************

  !!
    dist.fetch_build_eggs(dist.setup_requires)
  running bdist_wheel
  running build
  running build_py
  creating build/lib.linux-x86_64-cpython-311/talib
  copying talib/stream.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/test_data.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/test_stream.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/test_abstract.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/__init__.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/abstract.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/test_pandas.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/test_func.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/deprecated.py -> build/lib.linux-x86_64-cpython-311/talib
  running build_ext
  building 'talib._ta_lib' extension
  creating build/temp.linux-x86_64-cpython-311/talib
  x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/usr/local/lib/python3.11/dist-packages/numpy/core/include -I/usr/include/python3.11 -c talib/_ta_lib.c -o build/temp.linux-x86_64-cpython-311/talib/_ta_lib.o
  talib/_ta_lib.c:196:12: fatal error: longintrepr.h: No such file or directory
    196 |   #include "longintrepr.h"
        |            ^~~~~~~~~~~~~~~

compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 error: subprocess-exited-with-error × python setup.py bdist_wheel 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. full command: /usr/bin/python3 -u -c ' exec(compile('"'"''"'"''"'"' # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py # # - It imports setuptools before invoking setup.py, to enable projects that directly # import from `distutils.core` to work with newer packaging standards. # - It provides a clear error message when setuptools is not installed. # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so # setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning: # manifest_maker: standard file '"'"'-c'"'"' not found". # - It generates a shim setup.py, for handling setup.cfg-only projects. import os, sys, tokenize try: import setuptools except ImportError as error: print( "ERROR: Can not execute `setup.py` since setuptools is not available in " "the build environment.", file=sys.stderr, ) sys.exit(1) _file_ = %r sys.argv[0] = _file_ if os.path.exists(_file_): filename = _file_ with tokenize.open(_file_) as f: setup_py_code = f.read() else: filename = "<auto-generated setuptools caller>" setup_py_code = "from setuptools import setup; setup()" exec(compile(setup_py_code, filename, "exec")) '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-cqn7e6xj/ta-lib_950d1d87302b426fb205e5027d92341f/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-sdmbwl9w cwd: /tmp/pip-install-cqn7e6xj/ta-lib_950d1d87302b426fb205e5027d92341f/ Building wheel for TA-Lib (setup.py) ... error ERROR: Failed building wheel for TA-Lib Running setup.py clean for TA-Lib Running command python setup.py clean /usr/local/lib/python3.11/dist-packages/setuptools/_init_.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !! ******************************************************************************** Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. ******************************************************************************** !! dist.fetch_build_eggs(dist.setup_requires) running clean removing 'build/temp.linux-x86_64-cpython-311' (and everything under it) removing 'build/lib.linux-x86_64-cpython-311' (and everything under it) 'build/bdist.linux-x86_64' does not exist -- can't clean it 'build/scripts-3.11' does not exist -- can't clean it removing 'build' Failed to build TA-Lib ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (TA-Lib)

I encountered an issue while trying to install the TA-Lib library on Google Colab after its recent update. Previously, I was able to install it using the following commands:

!wget http://prdownloads.sourcefe/ta-lib/ta-lib-0.4.0-src.tar.gz
!tar -xzf ta-lib-0.4.0-src.tar.gz
%cd ta-lib
!./configure --prefix=/usr
!make
!sudo make install
!pip install TA-Lib==0.4.19

However, when I run this code now, I receive the following error:

Using pip 24.1.2 from /usr/local/lib/python3.11/dist-packages/pip (python 3.11)
Collecting TA-Lib==0.4.19
  Using cached TA-Lib-0.4.19.tar.gz (267 kB)
  Running command python setup.py egg_info
  /usr/local/lib/python3.11/dist-packages/setuptools/__init__.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
  !!

          ********************************************************************************
          Requirements should be satisfied by a PEP 517 installer.
          If you are using pip, you can try `pip install --use-pep517`.
          ********************************************************************************

  !!
    dist.fetch_build_eggs(dist.setup_requires)
  running egg_info
  creating /tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info
  writing /tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file '/tmp/pip-pip-egg-info-dz2n0g3u/TA_Lib.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /usr/local/lib/python3.11/dist-packages (from TA-Lib==0.4.19) (1.26.4)
Building wheels for collected packages: TA-Lib
  Running command python setup.py bdist_wheel
  /usr/local/lib/python3.11/dist-packages/setuptools/__init__.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
  !!

          ********************************************************************************
          Requirements should be satisfied by a PEP 517 installer.
          If you are using pip, you can try `pip install --use-pep517`.
          ********************************************************************************

  !!
    dist.fetch_build_eggs(dist.setup_requires)
  running bdist_wheel
  running build
  running build_py
  creating build/lib.linux-x86_64-cpython-311/talib
  copying talib/stream.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/test_data.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/test_stream.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/test_abstract.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/__init__.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/abstract.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/test_pandas.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/test_func.py -> build/lib.linux-x86_64-cpython-311/talib
  copying talib/deprecated.py -> build/lib.linux-x86_64-cpython-311/talib
  running build_ext
  building 'talib._ta_lib' extension
  creating build/temp.linux-x86_64-cpython-311/talib
  x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/usr/local/lib/python3.11/dist-packages/numpy/core/include -I/usr/include/python3.11 -c talib/_ta_lib.c -o build/temp.linux-x86_64-cpython-311/talib/_ta_lib.o
  talib/_ta_lib.c:196:12: fatal error: longintrepr.h: No such file or directory
    196 |   #include "longintrepr.h"
        |            ^~~~~~~~~~~~~~~

compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1 error: subprocess-exited-with-error × python setup.py bdist_wheel 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. full command: /usr/bin/python3 -u -c ' exec(compile('"'"''"'"''"'"' # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py # # - It imports setuptools before invoking setup.py, to enable projects that directly # import from `distutils.core` to work with newer packaging standards. # - It provides a clear error message when setuptools is not installed. # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so # setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning: # manifest_maker: standard file '"'"'-c'"'"' not found". # - It generates a shim setup.py, for handling setup.cfg-only projects. import os, sys, tokenize try: import setuptools except ImportError as error: print( "ERROR: Can not execute `setup.py` since setuptools is not available in " "the build environment.", file=sys.stderr, ) sys.exit(1) _file_ = %r sys.argv[0] = _file_ if os.path.exists(_file_): filename = _file_ with tokenize.open(_file_) as f: setup_py_code = f.read() else: filename = "<auto-generated setuptools caller>" setup_py_code = "from setuptools import setup; setup()" exec(compile(setup_py_code, filename, "exec")) '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-cqn7e6xj/ta-lib_950d1d87302b426fb205e5027d92341f/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-sdmbwl9w cwd: /tmp/pip-install-cqn7e6xj/ta-lib_950d1d87302b426fb205e5027d92341f/ Building wheel for TA-Lib (setup.py) ... error ERROR: Failed building wheel for TA-Lib Running setup.py clean for TA-Lib Running command python setup.py clean /usr/local/lib/python3.11/dist-packages/setuptools/_init_.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !! ******************************************************************************** Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. ******************************************************************************** !! dist.fetch_build_eggs(dist.setup_requires) running clean removing 'build/temp.linux-x86_64-cpython-311' (and everything under it) removing 'build/lib.linux-x86_64-cpython-311' (and everything under it) 'build/bdist.linux-x86_64' does not exist -- can't clean it 'build/scripts-3.11' does not exist -- can't clean it removing 'build' Failed to build TA-Lib ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (TA-Lib)

Share Improve this question asked Jan 17 at 21:53 kamil uralkamil ural 11 bronze badge 1
  • This is the core of the problem: fatal error: longintrepr.h: No such file or directory The file was in directory include in older Python versions but later it was moved to include/cpython. You're trying to install old version of TA-Lib, 0.4.19 which is only compatible with Pythons up to 3.8. Use Python 3.8 or try later version of TA-Lib: pypi./project/ta-lib/#history – phd Commented Jan 17 at 22:01
Add a comment  | 

2 Answers 2

Reset to default 0

Try this; it worked for me:

!curl -L http://prdownloads.sourcefe/ta-lib/ta-lib-0.4.0-src.tar.gz -O && tar xzvf ta-lib-0.4.0-src.tar.gz
!cd ta-lib && ./configure --prefix=/usr && make && make install && cd - && pip install TA-Lib==0.4.37 --no-cache-dir --force

For a somewhat fast installation.

url = 'https://anaconda./conda-fe/libta-lib/0.4.0/download/linux-64/libta-lib-0.4.0-h166bdaf_1.tar.bz2'
!curl -L $url | tar xj -C /usr/lib/x86_64-linux-gnu/ lib --strip-components=1
!pip install conda-package-handling
!wget https://anaconda./conda-fe/ta-lib/0.5.1/download/linux-64/ta-lib-0.5.1-py311h9ecbd09_0.conda
!cph x ta-lib-0.5.1-py311h9ecbd09_0.conda
!mv ./ta-lib-0.5.1-py311h9ecbd09_0/lib/python3.11/site-packages/talib /usr/local/lib/python3.11/dist-packages/
import talib
发布评论

评论列表(0)

  1. 暂无评论