Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR:: Could not find a local HDF5 installation. #4162

Closed
Michel-Settembrino opened this issue Jan 7, 2021 · 9 comments · Fixed by #4164
Closed

ERROR:: Could not find a local HDF5 installation. #4162

Michel-Settembrino opened this issue Jan 7, 2021 · 9 comments · Fixed by #4164
Labels
Install Problems with installation

Comments

@Michel-Settembrino
Copy link

Describe your environment

  • Operating system: macOS Big Sur Version 11.0.1
  • Python Version: 2.7.16 (python -V)
  • Python3 Version: 3.9.1 (python3 -V)
  • CCXT version: _____ (pip freeze | grep ccxt)
  • Freqtrade Version: ____ (freqtrade -V or docker-compose run --rm freqtrade -V for Freqtrade running in docker)

Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.

Describe the problem:

Explain the problem you have encountered

Error during installation using default script ./setup.sh --install

Steps to reproduce:

  1. ./setup.sh --install

Observed Results:

  • What happened?
    Installation failed.
  • What did you expect to happen?
    A running installation.

Relevant code exceptions or logs

Note: Please copy/paste text of the messages, no screenshots of logs please.

Collecting tables==3.6.1
Using cached tables-3.6.1.tar.gz (4.6 MB)
  ERROR: Command errored out with exit status 1:
   command: /Users/michel/Crypto-bots/freqtrade/.env/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sv/f00rtph94cj0k1ntrvxxpsnh0000gn/T/pip-install-m6ukwy7f/tables_ac85413363944fa59515c6933d5c3876/setup.py'"'"'; __file__='"'"'/private/var/folders/sv/f00rtph94cj0k1ntrvxxpsnh0000gn/T/pip-install-m6ukwy7f/tables_ac85413363944fa59515c6933d5c3876/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/sv/f00rtph94cj0k1ntrvxxpsnh0000gn/T/pip-pip-egg-info-aqdglu39
       cwd: /private/var/folders/sv/f00rtph94cj0k1ntrvxxpsnh0000gn/T/pip-install-m6ukwy7f/tables_ac85413363944fa59515c6933d5c3876/
  Complete output (7 lines):
  clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11'
  * Using Python 3.9.1 (default, Dec 29 2020, 09:45:39)
  * 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.
  ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
@Michel-Settembrino Michel-Settembrino added the Triage Needed Issues yet to verify label Jan 7, 2021
@xmatthias xmatthias added the Install Problems with installation label Jan 7, 2021
@xmatthias
Copy link
Member

xmatthias commented Jan 7, 2021

To be honest, it's a known issue with macOS and python 3.9.

I've opened an issue a while ago requesting wheels for it so the base dependency is not needed - but so far they've not been created (not for MacOS, anyway).

Feel free to submit to the issue i opened (PyTables/PyTables#823) for updates on it.


I guess you can solve this somehow by installing a hdf5 binary to your system so it's available for the compilation process.
However, since i don't own a mac, i will not be able to support (maybe check in the PyTables repository, they may have some answers / guides how to install from sources on a mac).

Alternatively, use python 3.8 for now, which does have wheels available, and should therefore install without going through this hastle.

edit
based on their readme, it should be brew install hdf5 - followed by trying the installation again.

Let me know if that works for you.

edit2 maybe also look at PyTables/PyTables#828 - if the steps described there solve this.

@xmatthias xmatthias removed the Triage Needed Issues yet to verify label Jan 7, 2021
@xmatthias
Copy link
Member

Please try to run brew install hdf5 c-blosc before starting the installation.

It seems to fix the problem in CI ... however i THINK that's a slightly older version of macOS...

@Michel-Settembrino
Copy link
Author

Michel-Settembrino commented Jan 8, 2021

I followed your first suggestion by first installing hdf5 using command brew install hdf5 and restart the installation.
The installation of hdf5 went good but not the installation of freqtrade. I have another issue.
This is the log:

Collecting webencodings
Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Using legacy 'setup.py install' for sdnotify, since package 'wheel' is not installed.
Using legacy 'setup.py install' for TA-Lib, since package 'wheel' is not installed.
Using legacy 'setup.py install' for tables, since package 'wheel' is not installed.
Using legacy 'setup.py install' for wrapt, since package 'wheel' is not installed.
Using legacy 'setup.py install' for yarl, since package 'wheel' is not installed.
Using legacy 'setup.py install' for docopt, since package 'wheel' is not installed.
Using legacy 'setup.py install' for MarkupSafe, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pandocfilters, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pycares, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pyrsistent, since package 'wheel' is not installed.
Using legacy 'setup.py install' for retrying, since package 'wheel' is not installed.
Using legacy 'setup.py install' for PyYAML, since package 'wheel' is not installed.
Building wheels for collected packages: py-find-1st
Building wheel for py-find-1st (PEP 517) ... error
ERROR: Command errored out with exit status 1:
 command: /Users/michel/Crypto-bots/freqtrade/.env/bin/python3.9 /Users/michel/Crypto-bots/freqtrade/.env/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/sv/f00rtph94cj0k1ntrvxxpsnh0000gn/T/tmp55cat798
     cwd: /private/var/folders/sv/f00rtph94cj0k1ntrvxxpsnh0000gn/T/pip-install-ig_77xfn/py-find-1st_37fb44144e2c4060844ac1a947852e8c
Complete output (15 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-11-x86_64-3.9
creating build/lib.macosx-11-x86_64-3.9/utils_find_1st
copying utils_find_1st/__init__.py -> build/lib.macosx-11-x86_64-3.9/utils_find_1st
running build_ext
check for clang compiler ... yes
building 'find_1st' extension
creating build/temp.macosx-11-x86_64-3.9
creating build/temp.macosx-11-x86_64-3.9/utils_find_1st
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNPY_NO_DEPRECATED_API=NPY_1_13_API_VERSION -I/private/var/folders/sv/f00rtph94cj0k1ntrvxxpsnh0000gn/T/pip-build-env-3cp9364_/overlay/lib/python3.9/site-packages/numpy/core/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/michel/Crypto-bots/freqtrade/.env/include -I/usr/local/Cellar/python@3.9/3.9.1_4/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c utils_find_1st/find_1st.cpp -o build/temp.macosx-11-x86_64-3.9/utils_find_1st/find_1st.o -Wno-unused-function
clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11'
error: command '/usr/bin/clang' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for py-find-1st
Failed to build py-find-1st
ERROR: Could not build wheels for py-find-1st which use PEP 517 and cannot be installed directly
Failed installing dependencies

@Michel-Settembrino
Copy link
Author

Michel-Settembrino commented Jan 8, 2021

I also tried instructions from PyTables/PyTables#828 but second command fails.

brew install c-blosc
pip3 install tables

@Michel-Settembrino
Copy link
Author

Michel-Settembrino commented Jan 8, 2021

I also tried brew install hdf5 c-blosc but another issue during install of freqtrade

Using legacy 'setup.py install' for PyYAML, since package 'wheel' is not installed.
Building wheels for collected packages: py-find-1st
  Building wheel for py-find-1st (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/michel/Crypto-bots/freqtrade/.env/bin/python3.9 /Users/michel/Crypto-bots/freqtrade/.env/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/sv/f00rtph94cj0k1ntrvxxpsnh0000gn/T/tmp4a_gw10y
       cwd: /private/var/folders/sv/f00rtph94cj0k1ntrvxxpsnh0000gn/T/pip-install-t257egie/py-find-1st_2d901bf5f67847ba9f331c2347dc1d95
  Complete output (15 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-11-x86_64-3.9
  creating build/lib.macosx-11-x86_64-3.9/utils_find_1st
  copying utils_find_1st/__init__.py -> build/lib.macosx-11-x86_64-3.9/utils_find_1st
  running build_ext
  check for clang compiler ... yes
  building 'find_1st' extension
  creating build/temp.macosx-11-x86_64-3.9
  creating build/temp.macosx-11-x86_64-3.9/utils_find_1st
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNPY_NO_DEPRECATED_API=NPY_1_13_API_VERSION -I/private/var/folders/sv/f00rtph94cj0k1ntrvxxpsnh0000gn/T/pip-build-env-qawbn8mo/overlay/lib/python3.9/site-packages/numpy/core/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/michel/Crypto-bots/freqtrade/.env/include -I/usr/local/Cellar/python@3.9/3.9.1_4/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c utils_find_1st/find_1st.cpp -o build/temp.macosx-11-x86_64-3.9/utils_find_1st/find_1st.o -Wno-unused-function
  clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11'
  error: command '/usr/bin/clang' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for py-find-1st
Failed to build py-find-1st
ERROR: Could not build wheels for py-find-1st which use PEP 517 and cannot be installed directly
Failed installing dependencies

@Michel-Settembrino
Copy link
Author

I got my issue solved and could install freqtrade.

Solution:

  1. brew install hdf5
  2. Update the XCode Command Line Tools to version 12.3
    This is to solve an issue with clang clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11'
    see this post: https://emilwypych.com/2020/11/23/pyenv-problem-macosx_deployment_target11-0/?cn-reloaded=1 for more info.
  3. ./setup.sh --install

@camxus
Copy link

camxus commented Jul 31, 2021

Solution

pip install cython

brew install hdf5

brew install c-blosc

export HDF5_DIR=/usr/local/

export BLOSC_DIR=/usr/local/

pip install tables

@pellet
Copy link

pellet commented Oct 30, 2021

I tried installing tables under ARM64(M1) but didn't have any luck, needed to follow @camxus directions under rosetta then it worked :)

@xmatthias
Copy link
Member

The recommended way to run freqtrade is using docker, where we also provide images for ARM64.

Native installation will be troublesome due to some dependencies, and support can best be found in each dependencies dedicated repository.

@freqtrade freqtrade locked as resolved and limited conversation to collaborators Oct 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Install Problems with installation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants