https://pantsbuild.org/ logo
#general
Title
# general
c

clean-night-52582

01/28/2022, 11:13 PM
Hey is there a good way to pass options to pip for the resolver job? trying to get my repo to work on a M1 mac and having some issues with installing
h5py
Found this stackoverflow post saying to pass
--no-binary=h5py
top
pip
https://stackoverflow.com/questions/66741778/how-to-install-h5py-needed-for-keras-on-macos-with-m1
h

happy-kitchen-89482

01/29/2022, 12:29 AM
The M1 fun keeps on coming! We'll have to make a documentation page for all these issues.
Let me look into this
Looks like you can only turn "binary" (i.e., wheel) usage on or off globally, not for a single package
Let me think about how to solve this
Which Pants version are you on?
c

clean-night-52582

01/29/2022, 12:59 AM
2.8.0
Going to start the update to 2.9.0 soon
h

happy-kitchen-89482

01/29/2022, 1:00 AM
What is he error that you get when trying to install h5py?
I ask because I think the
--no-binary
thing is a red herring. There is no
macos_10_9_arm64
wheel for
h5py
on PyPI (see https://pypi.org/project/h5py/#files), so pip will build from the sdist anyway, even without that flag.
1
What remains is to figure out why it is failing to do so.
And my guess would be that it's because that
HDF5_DIR
env var isn't propagated into the sandbox
👀 1
To propagate it, set this in the
[subprocess-environment]
section in pants.toml:
Copy code
[subprocess-environment]
env_vars.add = ["HDF5_DIR"]
That passes that env var through to running processes, including the pip process
Let me know if this sorts it out!
Oh, and whether it does or not, could you open an issue for this at https://github.com/pantsbuild/pants/issues/new/choose ? Then we can preserve the fix for posterity
c

clean-night-52582

01/29/2022, 10:11 PM
Sure I'll give it a shot and open a issue thanks!
h

happy-kitchen-89482

01/30/2022, 4:17 PM
(I gave the wrong issue link, it should have been, and has now been corrected to, https://github.com/pantsbuild/pants/issues/new/choose)
c

clean-night-52582

01/30/2022, 10:44 PM
Don't have the M1 mac so can't try the fix yet but will get my colleague to try and report back
4 Views