使用 python 3.11 安装 PyTables 在 macOS M1 上失败

the*_*ema 6 python macos hdf5 cython pytables

$ python -m pip install tables\n
Run Code Online (Sandbox Code Playgroud)\n

停止于

\n
\n

错误:编译 Cython 文件

\n
\n

环境\n(我位于使用 pyenv 创建的虚拟环境中。

\n

atm 只安装了很少的软件包

\n
Package    Version\n---------- -------\nCython     3.0.0\nnumpy      1.25.1\npip        23.2.1\nsetuptools 65.5.0\nwheel      0.41.0\n
Run Code Online (Sandbox Code Playgroud)\n

我的出口

\n
export HDF5_DIR="$(brew --prefix hdf5)"\nexport BLOSC_DIR="$(brew --prefix c-blosc)"\nexport C_INCLUDE_PATH=/opt/homebrew/Cellar/lzo/2.10/include/lzo:/opt/homebrew/Cellar/lzo/2.10/include/\nexport LIBRARY_PATH=/opt/homebrew/lib\n
Run Code Online (Sandbox Code Playgroud)\n

这是完整的错误消息:

\n
$ python -m pip install tables                                                                                                                                                                                                        \xe2\x94\x80\xe2\x95\xaf\nCollecting tables\n  Using cached tables-3.8.0.tar.gz (8.0 MB)\n  Installing build dependencies ... done\n  Getting requirements to build wheel ... error\n  error: subprocess-exited-with-error\n\n  \xc3\x97 Getting requirements to build wheel did not run successfully.\n  \xe2\x94\x82 exit code: 1\n  \xe2\x95\xb0\xe2\x94\x80> [51 lines of output]\n      <string>:19: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html\n\n      Error compiling Cython file:\n      ------------------------------------------------------------\n      ...\n\n\n      def _dump_h5_backtrace():\n          cdef object bt = []\n\n          if H5Ewalk(H5E_DEFAULT, H5E_WALK_DOWNWARD, e_walk_cb, <void*>bt) < 0:\n                                                     ^\n      ------------------------------------------------------------\n\n      tables/utilsextension.pyx:384:47: Cannot assign type \'herr_t (unsigned int, const H5E_error_t *, void *) except? -1 nogil\' to \'H5E_walk_t\'\n      cpuinfo failed, assuming no CPU features: \'flags\'\n      * Using Python 3.11.4 (main, Jul 27 2023, 14:26:12) [Clang 14.0.3 (clang-1403.0.22.14.1)]\n      * Found cython 3.0.0\n      * USE_PKGCONFIG: False\n      * Found HDF5 headers at ``/opt/homebrew/opt/hdf5/include``, library at ``/opt/homebrew/opt/hdf5/lib``.\n      * Found LZO 2 headers at ``/opt/homebrew/Cellar/lzo/2.10/include``, the library is located in the standard system search dirs.\n      * Skipping detection of LZO 1 since LZO 2 has already been found.\n      * Found bzip2 headers at ``/opt/homebrew/opt/bzip2/include``, library at ``/opt/homebrew/opt/bzip2/lib``.\n      * Found blosc headers at ``/opt/homebrew/opt/c-blosc/include``, library at ``/opt/homebrew/opt/c-blosc/lib``.\n      * Found blosc2 headers at ``/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-n4mpp65u/overlay/include``, library at ``/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-n4mpp65u/overlay/lib``.\n        * Copying blosc2 runtime library to \'tables\' dir because it was not found in standard locations\n      Compiling tables/utilsextension.pyx because it changed.\n      [1/1] Cythonizing tables/utilsextension.pyx\n      Traceback (most recent call last):\n        File "/Users/mario.theuermann/.pyenv/versions/i4SEE-sandbox/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>\n          main()\n        File "/Users/mario.theuermann/.pyenv/versions/i4SEE-sandbox/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main\n          json_out[\'return_val\'] = hook(**hook_input[\'kwargs\'])\n                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        File "/Users/mario.theuermann/.pyenv/versions/i4SEE-sandbox/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel\n          return hook(config_settings)\n                 ^^^^^^^^^^^^^^^^^^^^^\n        File "/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-n4mpp65u/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel\n          return self._get_build_requires(config_settings, requirements=[\'wheel\'])\n                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n        File "/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-n4mpp65u/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires\n          self.run_setup()\n        File "/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-n4mpp65u/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup\n          exec(code, locals())\n        File "<string>", line 928, in <module>\n        File "<string>", line 923, in get_cython_extfiles\n        File "/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-n4mpp65u/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize\n          cythonize_one(*args)\n        File "/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-n4mpp65u/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one\n          raise CompileError(None, pyx_file)\n      Cython.Compiler.Errors.CompileError: tables/utilsextension.pyx\n      [end of output]\n
Run Code Online (Sandbox Code Playgroud)\n

到目前为止我调查了什么

\n

H5Ewalk() 已重命名为 H5Ewalk1() 并在 1.8.0 中弃用,如下所述:\n https://docs.hdfgroup.org/hdf5/develop/group___h5_e.html#title29

\n

我使用 1.14.1,所以我不太明白构建似乎使用了这个已弃用的函数?

\n
$ brew info hdf5                                                                                                                                                                                                                      \n==> hdf5: stable 1.14.1 (bottled)\n
Run Code Online (Sandbox Code Playgroud)\n

测试表3.7.0

\n

这个版本不会出现上面的错误,但是在我的requirements.txt文件包安装的以下步骤中:

\n
Building wheels for collected packages: lxml, python-pptx, simplekml, tables, timezonefinder\n  Building wheel for lxml (setup.py) ... done\n  Created wheel for lxml: filename=lxml-4.9.2-cp311-cp311-macosx_13_0_arm64.whl size=1642538 sha256=00fdcd8bd9a533750afc5c27015d13fc99e25cad31f7f8d91b200cd4806ca7ef\n  Stored in directory: /Users/mario.theuermann/Library/Caches/pip/wheels/fb/5b/f7/0a27880b4a007daeff53a196d01901627f640392b7e76e76e5\n  Building wheel for python-pptx (setup.py) ... done\n  Created wheel for python-pptx: filename=python_pptx-0.6.21-py3-none-any.whl size=470934 sha256=05c7f46456d4ab5df20c574b3b051386e6965af187d1b31ee469b01d5e42f144\n  Stored in directory: /Users/mario.theuermann/Library/Caches/pip/wheels/f4/c7/af/d1d91f3decfaa7621033f30b69a29bf0b1206005663d233e7a\n  Building wheel for simplekml (setup.py) ... done\n  Created wheel for simplekml: filename=simplekml-1.3.6-py3-none-any.whl size=65860 sha256=1c1b2052ef80cfc795ba6a281a718c7a338a10723bd388c18b6910ce40356f0c\n  Stored in directory: /Users/mario.theuermann/Library/Caches/pip/wheels/72/3e/80/c3e5c354c3cbe62d8c5e4fb63d9e7cdccc7f93399997ae465f\n  Building wheel for tables (pyproject.toml) ... error\n  error: subprocess-exited-with-error\n\n  \xc3\x97 Building wheel for tables (pyproject.toml) did not run successfully.\n  \xe2\x94\x82 exit code: 1\n  \xe2\x95\xb0\xe2\x94\x80> [296 lines of output]\n      <string>:18: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html\n      cpuinfo failed, assuming no CPU features: No module named \'cpuinfo\'\n      * Using Python 3.11.4 (main, Jul 27 2023, 14:26:12) [Clang 14.0.3 (clang-1403.0.22.14.1)]\n      * Found cython 3.0.0\n      * USE_PKGCONFIG: False\n      * Found HDF5 headers at ``/opt/homebrew/opt/hdf5/include``, library at ``/opt/homebrew/opt/hdf5/lib``.\n      * Found LZO 2 headers at ``/opt/homebrew/Cellar/lzo/2.10/include``, the library is located in the standard system search dirs.\n      * Skipping detection of LZO 1 since LZO 2 has already been found.\n      * Found bzip2 headers at ``/opt/homebrew/opt/bzip2/include``, library at ``/opt/homebrew/opt/bzip2/lib``.\n      * Found blosc headers at ``/opt/homebrew/opt/c-blosc/include``, library at ``/opt/homebrew/opt/c-blosc/lib``.\n      running bdist_wheel\n      running build\n      running build_py\n      creating build\n      creating build/lib.macosx-13.4-arm64-cpython-311\n      creating build/lib.macosx-13.4-arm64-cpython-311/tables\n      copying tables/link.py -> build/lib.macosx-13.4-arm64-cpython-311/tables\n      copying tables/description.py -> build/lib.macosx-13.4-arm64-cpython-311/tables\n      copying tables/index.py -> build/lib.macosx-13.4-arm64-cpython-311/tables\n      copying tables/attributeset.py -> build/lib.macosx-13.4-arm64-cpython-311/tables\n      copying tables/registry.py -> build/lib.macosx-13.4-arm64-cpython-311/tables\n      copying tables/leaf.py -> build/lib.macosx-13.4-arm64-cpython-311/tables\n      copying tables/carray.py -> build/lib.macosx-13.4-arm64-cpython-311/tables\n      copying tables/__init__.py -> build/lib.macosx-13.4-arm64-cpython-311/tables\n      copying tables/unimplemented.py -> build/lib.macosx-13.4-arm64-cpython-311/tables\n\n.\n.\n.\n.\n.\n      running build_ext\n      building \'tables.utilsextension\' extension\n      creating build/temp.macosx-13.4-arm64-cpython-311/hdf5-blosc\n      creating build/temp.macosx-13.4-arm64-cpython-311/hdf5-blosc/src\n      creating build/temp.macosx-13.4-arm64-cpython-311/src\n      creating build/temp.macosx-13.4-arm64-cpython-311/tables\n      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/bzip2/include -DNDEBUG=1 -DHAVE_LZO2_LIB=1 -DHAVE_BZ2_LIB=1 -DHAVE_BLOSC_LIB=1 -Ihdf5-blosc/src -I/opt/homebrew/Cellar/lzo/2.10/include/lzo -I/opt/homebrew/Cellar/lzo/2.10/include -I/opt/homebrew/opt/bzip2/include -I/usr/local/include -I/sw/include -I/opt/include -I/opt/local/include -I/usr/include -I/include -I/opt/homebrew/opt/hdf5/include -I/opt/homebrew/opt/c-blosc/include -I/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-kvflwhff/overlay/lib/python3.11/site-packages/numpy/core/include -I/Users/mario.theuermann/.pyenv/versions/i4SEE-sandbox/include -I/Users/mario.theuermann/.pyenv/versions/3.11.4/include/python3.11 -c hdf5-blosc/src/blosc_filter.c -o build/temp.macosx-13.4-arm64-cpython-311/hdf5-blosc/src/blosc_filter.o -Isrc -DH5_USE_18_API -DH5Acreate_vers=2 -DH5Aiterate_vers=2 -DH5Dcreate_vers=2 -DH5Dopen_vers=2 -DH5Eclear_vers=2 -DH5Eprint_vers=2 -DH5Epush_vers=2 -DH5Eset_auto_vers=2 -DH5Eget_auto_vers=2 -DH5Ewalk_vers=2 -DH5E_auto_t_vers=2 -DH5Gcreate_vers=2 -DH5Gopen_vers=2 -DH5Pget_filter_vers=2 -DH5Pget_filter_by_id_vers=2 -DH5Tarray_create_vers=2 -DH5Tget_array_dims_vers=2 -DH5Z_class_t_vers=2 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION\n      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/bzip2/include -DNDEBUG=1 -DHAVE_LZO2_LIB=1 -DHAVE_BZ2_LIB=1 -DHAVE_BLOSC_LIB=1 -Ihdf5-blosc/src -I/opt/homebrew/Cellar/lzo/2.10/include/lzo -I/opt/homebrew/Cellar/lzo/2.10/include -I/opt/homebrew/opt/bzip2/include -I/usr/local/include -I/sw/include -I/opt/include -I/opt/local/include -I/usr/include -I/include -I/opt/homebrew/opt/hdf5/include -I/opt/homebrew/opt/c-blosc/include -I/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-kvflwhff/overlay/lib/python3.11/site-packages/numpy/core/include -I/Users/mario.theuermann/.pyenv/versions/i4SEE-sandbox/include -I/Users/mario.theuermann/.pyenv/versions/3.11.4/include/python3.11 -c src/H5ARRAY.c -o build/temp.macosx-13.4-arm64-cpython-311/src/H5ARRAY.o -Isrc -DH5_USE_18_API -DH5Acreate_vers=2 -DH5Aiterate_vers=2 -DH5Dcreate_vers=2 -DH5Dopen_vers=2 -DH5Eclear_vers=2 -DH5Eprint_vers=2 -DH5Epush_vers=2 -DH5Eset_auto_vers=2 -DH5Eget_auto_vers=2 -DH5Ewalk_vers=2 -DH5E_auto_t_vers=2 -DH5Gcreate_vers=2 -DH5Gopen_vers=2 -DH5Pget_filter_vers=2 -DH5Pget_filter_by_id_vers=2 -DH5Tarray_create_vers=2 -DH5Tget_array_dims_vers=2 -DH5Z_class_t_vers=2 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION\n      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/bzip2/include -DNDEBUG=1 -DHAVE_LZO2_LIB=1 -DHAVE_BZ2_LIB=1 -DHAVE_BLOSC_LIB=1 -Ihdf5-blosc/src -I/opt/homebrew/Cellar/lzo/2.10/include/lzo -I/opt/homebrew/Cellar/lzo/2.10/include -I/opt/homebrew/opt/bzip2/include -I/usr/local/include -I/sw/include -I/opt/include -I/opt/local/include -I/usr/include -I/include -I/opt/homebrew/opt/hdf5/include -I/opt/homebrew/opt/c-blosc/include -I/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-kvflwhff/overlay/lib/python3.11/site-packages/numpy/core/include -I/Users/mario.theuermann/.pyenv/versions/i4SEE-sandbox/include -I/Users/mario.theuermann/.pyenv/versions/3.11.4/include/python3.11 -c src/H5ATTR.c -o build/temp.macosx-13.4-arm64-cpython-311/src/H5ATTR.o -Isrc -DH5_USE_18_API -DH5Acreate_vers=2 -DH5Aiterate_vers=2 -DH5Dcreate_vers=2 -DH5Dopen_vers=2 -DH5Eclear_vers=2 -DH5Eprint_vers=2 -DH5Epush_vers=2 -DH5Eset_auto_vers=2 -DH5Eget_auto_vers=2 -DH5Ewalk_vers=2 -DH5E_auto_t_vers=2 -DH5Gcreate_vers=2 -DH5Gopen_vers=2 -DH5Pget_filter_vers=2 -DH5Pget_filter_by_id_vers=2 -DH5Tarray_create_vers=2 -DH5Tget_array_dims_vers=2 -DH5Z_class_t_vers=2 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION\n      src/H5ATTR.c:453:8: warning: explicitly assigning value of variable of type \'hid_t\' (aka \'long long\') to itself [-Wself-assign]\n       loc_id=loc_id;\n       ~~~~~~^~~~~~~\n      1 warning generated.\n      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/bzip2/include -DNDEBUG=1 -DHAVE_LZO2_LIB=1 -DHAVE_BZ2_LIB=1 -DHAVE_BLOSC_LIB=1 -Ihdf5-blosc/src -I/opt/homebrew/Cellar/lzo/2.10/include/lzo -I/opt/homebrew/Cellar/lzo/2.10/include -I/opt/homebrew/opt/bzip2/include -I/usr/local/include -I/sw/include -I/opt/include -I/opt/local/include -I/usr/include -I/include -I/opt/homebrew/opt/hdf5/include -I/opt/homebrew/opt/c-blosc/include -I/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-kvflwhff/overlay/lib/python3.11/site-packages/numpy/core/include -I/Users/mario.theuermann/.pyenv/versions/i4SEE-sandbox/include -I/Users/mario.theuermann/.pyenv/versions/3.11.4/include/python3.11 -c src/utils.c -o build/temp.macosx-13.4-arm64-cpython-311/src/utils.o -Isrc -DH5_USE_18_API -DH5Acreate_vers=2 -DH5Aiterate_vers=2 -DH5Dcreate_vers=2 -DH5Dopen_vers=2 -DH5Eclear_vers=2 -DH5Eprint_vers=2 -DH5Epush_vers=2 -DH5Eset_auto_vers=2 -DH5Eget_auto_vers=2 -DH5Ewalk_vers=2 -DH5E_auto_t_vers=2 -DH5Gcreate_vers=2 -DH5Gopen_vers=2 -DH5Pget_filter_vers=2 -DH5Pget_filter_by_id_vers=2 -DH5Tarray_create_vers=2 -DH5Tget_array_dims_vers=2 -DH5Z_class_t_vers=2 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION\n      src/utils.c:290:14: warning: variable \'namedtypes\' set but not used [-Wunused-but-set-variable]\n        int        namedtypes = 0;\n                   ^\n      1 warning generated.\n      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/bzip2/include -DNDEBUG=1 -DHAVE_LZO2_LIB=1 -DHAVE_BZ2_LIB=1 -DHAVE_BLOSC_LIB=1 -Ihdf5-blosc/src -I/opt/homebrew/Cellar/lzo/2.10/include/lzo -I/opt/homebrew/Cellar/lzo/2.10/include -I/opt/homebrew/opt/bzip2/include -I/usr/local/include -I/sw/include -I/opt/include -I/opt/local/include -I/usr/include -I/include -I/opt/homebrew/opt/hdf5/include -I/opt/homebrew/opt/c-blosc/include -I/private/var/folders/h2/tcw923v140sbnqcz0p0xp3y80000gp/T/pip-build-env-kvflwhff/overlay/lib/python3.11/site-packages/numpy/core/include -I/Users/mario.theuermann/.pyenv/versions/i4SEE-sandbox/include -I/Users/mario.theuermann/.pyenv/versions/3.11.4/include/python3.11 -c tables/utilsextension.c -o build/temp.macosx-13.4-arm64-cpython-311/tables/utilsextension.o -Isrc -DH5_USE_18_API -DH5Acreate_vers=2 -DH5Aiterate_vers=2 -DH5Dcreate_vers=2 -DH5Dopen_vers=2 -DH5Eclear_vers=2 -DH5Eprint_vers=2 -DH5Epush_vers=2 -DH5Eset_auto_vers=2 -DH5Eget_auto_vers=2 -DH5Ewalk_vers=2 -DH5E_auto_t_vers=2 -DH5Gcreate_vers=2 -DH5Gopen_vers=2 -DH5Pget_filter_vers=2 -DH5Pget_filter_by_id_vers=2 -DH5Tarray_create_vers=2 -DH5Tget_array_dims_vers=2 -DH5Z_class_t_vers=2 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION\n      tables/utilsextension.c:8032:52: warning: comparison of integers of different signs: \'hsize_t\' (aka \'unsigned long long\') and \'long long\' [-Wsign-compare]\n              __pyx_t_2 = (((__pyx_v_maxdims[__pyx_v_i]) == -1LL) != 0);\n                             ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^  ~~~~\n      tables/utilsextension.c:12367:33: warning: comparison of integers of different signs: \'int\' and \'hsize_t\' (aka \'unsigned long long\') [-Wsign-compare]\n        for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {\n                            ~~~~~~~~~ ^ ~~~~~~~~~\n      tables/utilsextension.c:15186:35: warning: comparison of integers of different signs: \'int\' and \'size_t\' (aka \'unsigned long\') [-Wsign-compare]\n          for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {\n                              ~~~~~~~~~ ^ ~~~~~~~~~\n      tables/utilsextension.c:15413:52: warning: comparison of integers of different signs: \'hsize_t\' (aka \'unsigned long long\') and \'long long\' [-Wsign-compare]\n              __pyx_t_3 = (((__pyx_v_maxdims[__pyx_v_j]) == -1LL) != 0);\n                             ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^  ~~~~\n      tables/utilsextension.c:22030:23: error: no member named \'exc_type\' in \'struct _err_stackitem\'\n          while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&\n                  ~~~~~~~~  ^\n      tables/utilsextension.c:22030:53: error: no member named \'exc_type\' in \'struct _err_stackitem\'\n          while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&\n                                                ~~~~~~~~  ^\n      tables/utilsextension.c:22044:23: error: no member named \'exc_type\' in \'struct _err_stackitem\'\n          *type = exc_info->exc_type;\n                  ~~~~~~~~  ^\n      tables/utilsextension.c:22046:21: error: no member named \'exc_traceback\' in \'struct _err_stackitem\'\n          *tb = exc_info->exc_traceback;\n                ~~~~~~~~  ^\n      tables/utilsextension.c:22060:26: error: no member named \'exc_type\' in \'struct _err_stackitem\'\n          tmp_type = exc_info->exc_type;\n                     ~~~~~~~~  ^\n      tables/utilsextension.c:22062:24: error: no member named \'exc_traceback\' in \'struct _err_stackitem\'\n          tmp_tb = exc_info->exc_traceback;\n                   ~~~~~~~~  ^\n      tables/utilsextension.c:22063:15: error: no member named \'exc_type\' in \'struct _err_stackitem\'\n          exc_info->exc_type = type;\n          ~~~~~~~~  ^\n      tables/utilsextension.c:22065:15: error: no member named \'exc_traceback\' in \'struct _err_stackitem\'\n          exc_

Mar*_*nes 6

我设法重现了您的问题,问题似乎是从 PyPi 安装软件包。从错误消息来看,Cython 似乎找不到lzo库。

提到的 GitHub 线程的解决方案似乎正在安装c-blosc,这也没有解决我的问题。

有两个选项对我有用:

  • 从 GitHub 安装包
pip3 install git+https://github.com/PyTables/PyTables
Run Code Online (Sandbox Code Playgroud)
  • 使用 conda 安装包
conda install -c anaconda pytables
Run Code Online (Sandbox Code Playgroud)