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

pip install fails (error: implicit declaration of function 'H5close' is invalid in C99) #109

Closed
nlaws-camus opened this issue Oct 13, 2022 · 3 comments

Comments

@nlaws-camus
Copy link
Contributor

nlaws-camus commented Oct 13, 2022

I am on a mac, os 12.2.1, M1 Pro and both pip3 install dsspy and cloning with pip install -e PyDSS give the same error (I tried Python 3.9 and 3.10):

% pip3 install dsspy     
Collecting dsspy
  Using cached dsspy-2.2.3-py3-none-any.whl (252 kB)
Collecting scipy
  Using cached scipy-1.9.2-cp310-cp310-macosx_12_0_arm64.whl (28.5 MB)
Collecting terminaltables
  Using cached terminaltables-3.1.10-py2.py3-none-any.whl (15 kB)
Collecting pymongo
  Downloading pymongo-4.2.0-cp310-cp310-macosx_10_15_universal2.whl (404 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 404.2/404.2 kB 1.4 MB/s eta 0:00:00
Collecting OpenDSSDirect.py>=0.6.0
  Using cached OpenDSSDirect.py-0.7.0-py3-none-any.whl (70 kB)
Collecting toml
  Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting requests
  Using cached requests-2.28.1-py3-none-any.whl (62 kB)
Collecting bokeh
  Using cached bokeh-2.4.3-py3-none-any.whl (18.5 MB)
Collecting networkx
  Using cached networkx-2.8.7-py3-none-any.whl (2.0 MB)
Collecting aiohttp-swagger3==0.4.3
  Using cached aiohttp_swagger3-0.4.3-py3-none-any.whl (1.7 MB)
Collecting tables
  Using cached tables-3.7.0.tar.gz (8.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      Error in sitecustomize; set PYTHONVERBOSE for traceback:
      AssertionError:
      /var/folders/lp/z4rnw6755rb4383yr_t2bbbr0000gp/T/H5closekqkx73ks.c:2:5: error: implicit declaration of function 'H5close' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          H5close();
          ^
      1 error generated.
      cpuinfo failed, assuming no CPU features: No module named 'cpuinfo'
      * Using Python 3.10.6 (main, Aug 11 2022, 13:36:31) [Clang 13.1.6 (clang-1316.0.21.2.5)]
      * 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.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build 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.
@nlaws-camus
Copy link
Contributor Author

maybe an M1 issue. I just tried on a similar mac with intel chip and pip install dsspy worked with Python 3.9

@daniel-thom
Copy link
Collaborator

@nlaws-camus Perhaps you saw this issue: PyTables/PyTables#832. Do workarounds listed their solve your issue?

@nlaws-camus
Copy link
Contributor Author

Thanks @daniel-thom ! Yes the following worked:

brew install hdf5 c-blosc lzo bzip2

followed by

HDF5_DIR=/opt/homebrew/opt/hdf5 BLOSC_DIR=/opt/homebrew/opt/c-blosc LZO_DIR=/opt/homebrew/opt/lzo BZIP2_DIR=/opt/homebrew/opt/bzip2 pip install -e PyDSS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants