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

Can't find numpy package build error #186

Closed
sean-engelstad opened this issue May 26, 2023 · 4 comments · Fixed by #183
Closed

Can't find numpy package build error #186

sean-engelstad opened this issue May 26, 2023 · 4 comments · Fixed by #183
Labels
bug Something isn't working

Comments

@sean-engelstad
Copy link
Contributor

sean-engelstad commented May 26, 2023

Numpy import error when building funtofem after make interface step found by @A-CGray.

pip install -e .
Obtaining file:///home/sengelstad6/git/funtofem
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/home/sengelstad6/git/funtofem/setup.py", line 6, in <module>
          import numpy
      ModuleNotFoundError: No module named 'numpy'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
make: *** [Makefile:37: interface] Error 1

@sean-engelstad (myself) found a solution to this issue with the following conda installation steps. Should we add a note to the README about this or is there another fix?
Pre-build steps

conda create -n F2F python=3.8
conda activate F2F
conda install -c conda-forge numpy mpi4py cython
conda install gxx_linux-64=9.3.0 -q -y

Then you either do the real build

cd ~/git/funtofem
make clean
make
make interface

Or the complex-mode build

cd ~/git/funtofem
make clean
make complex
make complex_interface
@sean-engelstad sean-engelstad added the bug Something isn't working label May 26, 2023
@sean-engelstad sean-engelstad changed the title Can't import numpy error Can't find numpy package build error May 26, 2023
@A-CGray
Copy link
Contributor

A-CGray commented May 26, 2023

I think @timryanb might be able to help out here since TACS has pretty much exactly the same build process and I don't have this issue there. I don't use conda so the proposed solution here wouldn't fix my issue, numpy probably just needs to be specified as a build dependency somewhere

@A-CGray
Copy link
Contributor

A-CGray commented May 26, 2023

Adding the pyproject.toml file from the TACS repo to F2F fixes the issue:

#pyproject.toml
[build-system]
# Minimum requirements for the build system to execute.
requires = ['setuptools>=45.0', 'wheel', 'cython>=0.29', 'oldest-supported-numpy', 'mpi4py==3.1.1']

@sean-engelstad
Copy link
Contributor Author

That sounds like a much better solution, I'll add it to that PR

@sean-engelstad
Copy link
Contributor Author

Added this pyproject.toml to the PR on moving pyfuntofem into funtofem. Linking this issue with the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants