简体   繁体   中英

Trying to install pytables for python3

I use pip python -m pip install tables

But then I get this error

Collecting tables
  Using cached tables-3.6.1.tar.gz (4.6 MB)
    ERROR: Command errored out with exit status 1:
     command: /Users/collin.dubois/.pyenv/versions/3.9.1/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_99aa9c30dedd4ec596aea4e44ada3c1c/setup.py'"'"'; __file__='"'"'/private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_99aa9c30dedd4ec596aea4e44ada3c1c/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-pip-egg-info-p0ecdq96
         cwd: /private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_99aa9c30dedd4ec596aea4e44ada3c1c/
    Complete output (10 lines):
    /var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/H5close1rzctrpl.c:2:5: error: implicit declaration of function 'H5close' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        H5close();
        ^
    1 error generated.
    * Using Python 3.9.1 (default, Feb  9 2021, 16:57:09)
    * USE_PKGCONFIG: True
    .. ERROR:: Could not find a local HDF5 installation.
       You may need to explicitly state where your local HDF5 headers and
       library can be found by setting the ``HDF5_DIR`` environment
       variable or by using the ``--hdf5`` command-line option.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/2b/32/847ee3f521aae6a0be380d923a736162d698586f444df1ac24b98c65025c/tables-3.6.1.tar.gz#sha256=49a972b8a7c27a8a173aeb05f67acb45fe608b64cd8e9fa667c0962a60b71b49 (from https://pypi.org/simple/tables/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached tables-3.5.2.tar.gz (7.8 MB)
    ERROR: Command errored out with exit status 1:
     command: /Users/collin.dubois/.pyenv/versions/3.9.1/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_8dfaf86b7caf47dcbafcd5579306579a/setup.py'"'"'; __file__='"'"'/private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_8dfaf86b7caf47dcbafcd5579306579a/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-pip-egg-info-60mnmhkv
         cwd: /private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_8dfaf86b7caf47dcbafcd5579306579a/
    Complete output (10 lines):
    /var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/H5closeq10kpd29.c:2:5: error: implicit declaration of function 'H5close' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        H5close();
        ^
    1 error generated.
    * Using Python 3.9.1 (default, Feb  9 2021, 16:57:09)
    * USE_PKGCONFIG: True
    .. ERROR:: Could not find a local HDF5 installation.
       You may need to explicitly state where your local HDF5 headers and
       library can be found by setting the ``HDF5_DIR`` environment
       variable or by using the ``--hdf5`` command-line option.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/73/51/6dabb2b94826e5db3aa2542b80f1382780b96a0cd13e0cfb637b36ede5c5/tables-3.5.2.tar.gz#sha256=b220e32262bab320aa41d33125a7851ff898be97c0de30b456247508e2cc33c2 (from https://pypi.org/simple/tables/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached tables-3.5.1.tar.gz (8.3 MB)
    ERROR: Command errored out with exit status 1:
     command: /Users/collin.dubois/.pyenv/versions/3.9.1/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_5bc73699d09a40c2b40def4a0095b1b4/setup.py'"'"'; __file__='"'"'/private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_5bc73699d09a40c2b40def4a0095b1b4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-pip-egg-info-4fky2xo8
         cwd: /private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_5bc73699d09a40c2b40def4a0095b1b4/
    Complete output (10 lines):
    /var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/H5closed5d6i0hx.c:2:5: error: implicit declaration of function 'H5close' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        H5close();
        ^
    1 error generated.
    * Using Python 3.9.1 (default, Feb  9 2021, 16:57:09)
    * USE_PKGCONFIG: True
    .. ERROR:: Could not find a local HDF5 installation.
       You may need to explicitly state where your local HDF5 headers and
       library can be found by setting the ``HDF5_DIR`` environment
       variable or by using the ``--hdf5`` command-line option.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/c6/e6/38cdcdc501ff889ea1e60bd5ef61d0573f73606f4dd0169786fd991c6b70/tables-3.5.1.tar.gz#sha256=88e2f3be1f143febc8bf8a7fe49ad51fc12518d6a1ac4eb641778d93e5dc2039 (from https://pypi.org/simple/tables/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached tables-3.4.4.tar.gz (4.6 MB)
    ERROR: Command errored out with exit status 1:
     command: /Users/collin.dubois/.pyenv/versions/3.9.1/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_db342c32f4a04906b9550c36cd3ecad2/setup.py'"'"'; __file__='"'"'/private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_db342c32f4a04906b9550c36cd3ecad2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-pip-egg-info-3uuf2txv
         cwd: /private/var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/pip-install-u9olbi_v/tables_db342c32f4a04906b9550c36cd3ecad2/
    Complete output (10 lines):
    /var/folders/77/mcsqy01d02s75d2q7j91_bjh0000gp/T/H5close4uirht4u.c:2:5: error: implicit declaration of function 'H5close' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        H5close();
        ^
    1 error generated.
    * Using Python 3.9.1 (default, Feb  9 2021, 16:57:09)
    * USE_PKGCONFIG: True

This is a case of either a missing HDF5 dependency or one which isn't installed in a standard way that the setup.py script of PyTables can find. See this thread for some detailed information on the this issue on MacOS and a couple comments related to Ubuntu.

If you are on MacOS, you can first simply try to brew install HDF5 and see if that helps. On *nix distros, make sure you have the dev package appropriate for your platform installed as well as the library, eg libhdf5-dev and libhdf5 .

If you have a custom build of HDF5, take a look at the link above for some helpful environment variables that can help inform pytables where to look for the HDF5 headers and libraries.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM