Trying to download h5py, could not build wheels - python

I am trying to download the h5py package on windows. I am trying to install it with the pip command using a git bash terminal.
I have made sure to have python and some other things to my PATH/Environment Variables. I tried redownloading vscode, and python, tried to update pip and some other commands from this link: https://bobbyhadz.com/blog/python-failed-building-wheel-for-h5py . I was able to succesfully download h5py on my mac, I was wondering if anyone could explain the difference too.
Loading library to get build settings and version: hdf5.dll
error: Unable to load dependency HDF5, make sure HDF5 is installed properly
error: Could not find module 'hdf5.dll' (or one of its dependencies). Try using the full path with constructor syntax.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for h5py
Failed to build h5py
ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects

Related

Error in building wheel for cryptography while installing firebase-admin on raspberry pi 3

I was installing firebase-admin using pip on my raspberry pi 3b+ using the following command:
pip3 install firebase-admin
However it always ends with an error saying "Error building wheel for cryptography"
Here is the full error message:
/tmp/pip-build-env-k7qo7p54/overlay/lib/python3.7/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning: Installing 'cryptography.hazmat.bindings._rust' as data is deprecated, please list it in packages.
!!
############################
# Package would be ignored #
############################
Python recognizes 'cryptography.hazmat.bindings._rust' as an importable package,
but it is not listed in the `packages` configuration of setuptools.
'cryptography.hazmat.bindings._rust' has been automatically added to the distribution only
because it may contain data files, but this behavior is likely to change
in future versions of setuptools (and therefore is considered deprecated).
Please make sure that 'cryptography.hazmat.bindings._rust' is included as a package by using
the `packages` configuration field or the proper discovery methods
(for example by using `find_namespace_packages(...)`/`find_namespace:`
instead of `find_packages(...)`/`find:`).
You can read more about "package discovery" and "data files" on setuptools
documentation page.
!!
check.warn(importable)
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation/ for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq/
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation/#rust
Python: 3.7.3
platform: Linux-5.10.103-v7+-armv7l-with-debian-10.13
pip: n/a
setuptools: 67.0.0
setuptools_rust: 1.5.2
rustc: n/a
=============================DEBUG ASSISTANCE=============================
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
This package requires Rust >=1.48.0.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
I have tried different commands like:
pip3 install firebase-admin
or
python -m pip install firebase-admin
I have upgraded pip and tried again, but still it didn't work
I faced a similar problem long time ago and solved by installing openssl. Tried it this time, it didn't work
Also tried installing rust compiler and using it but it didn't work
I am using Raspbian OS Buster on my Raspberry Pi 3
I have tried fresh installs of the OS
Still the same problem occurs

I am running into errors installing a requirements.txt. The issue I am having is with pillow

I am relatively new to the world of coding and am mostly self taught. Currently I am working on a project via a repository from GitHub. One of the steps in working with the code is to install python dependencies via a requirements.txt
I am currently running into errors with pillow. I am working in windows, and currently have python 3.9.7 and conda 4.13.0. When I run the python -m pip install --upgrade -r requirements.txt i get errors as follows:
1) Building wheels for collected packages: pillow
Building wheel for pillow (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [189 lines of output]
C:\Users\kj\AppData\Local\Temp\pip-install-hsdc08bl\pillow_07ce73d2c2484297acb81cb082ed4b48\setup.py:29: RuntimeWarning: Pillow does not yet support Python 3.9 and does not yet provide prebuilt Windows binaries. We do not recommend building from source on Windows.
2) During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\kj\AppData\Local\Temp\pip-install-hsdc08bl\pillow_07ce73d2c2484297acb81cb082ed4b48\setup.py", line 888, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pillow
3) Running setup.py clean for pillow
Failed to build pillow
Installing collected packages: pillow, h5py, pandas, matplotlib, sklearn, scikit-image
Attempting uninstall: pillow
Found existing installation: Pillow 9.1.1
Uninstalling Pillow-9.1.1:
Successfully uninstalled Pillow-9.1.1
Running setup.py install for pillow ... error
error: subprocess-exited-with-error
× Running setup.py install for pillow did not run successfully.
│ exit code: 1
╰─> [193 lines of output]
C:\Users\kj\AppData\Local\Temp\pip-install-hsdc08bl\pillow_07ce73d2c2484297acb81cb082ed4b48\setup.py:29: RuntimeWarning: Pillow does not yet support Python 3.9 and does not yet provide prebuilt Windows binaries. We do not recommend building from source on Windows.
4) The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: No metadata found in c:\programdata\anaconda3\lib\site-packages
Rolling back uninstall of pillow
Moving to c:\programdata\anaconda3\lib\site-packages\pil\
from C:\ProgramData\Anaconda3\Lib\site-packages\~il
Moving to c:\programdata\anaconda3\lib\site-packages\pillow-9.1.1.dist-info\
from C:\ProgramData\Anaconda3\Lib\site-packages\~illow-9.1.1.dist-info
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pillow
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
These are all the errors I get when I run the install of requirements.txt. I have done some research on my own before looking for help as there are similar questions I have come across. One issue is that pillow does not yet support python 3.9. However, on pillows readthedoc it claims that python 3.9 is supported by pillow >=9.0, and I have pillow 9.1.1 installed. Another issue I see is the headers or library files could not be found for zlib, yet I have used conda install -c anaconda zlib.
To reiterate, I am relatively still a beginner with code. I would appreciate any friendly advice with my current issues.
Thank you
When installing this library, pip tried to find a pre-compiled binary (bdist_wheel) but couldn't find one that matches your python version and OS. So it tried to build it from source, but you don't have zlib installed on your machine. zlib is another program that is used in the python build process. You can install it for windows from here, or I think it is bundled with Python if you install Python using the "Full Installer" as described here: https://docs.python.org/3/using/windows.html

ERROR: failed building wheel when installing spectral-cube (astropy)

I'm trying to install the package spectral-cube from the astropy project using pip (22.0.4). I get a long error which ends with this:
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for casa-formats-io.
Failed to build casa-formats-io.
ERROR: Could not build wheels for casa-formats-io, which is required to install pyproject.toml-based projects
Even after downloading casa-formats-io from their github I still get this error.
I've also tried installing this using conda, but the error is the same.
I'm using MacOS 12.3. But I had the problem with older versions.
I'm kind of confused as to what I can do.
Thanks for the help!
I was able to fix my own problem. The error appeared because the package I was trying to download wasn't available/compatible with the newest python version (3.10). So, I simply uninstalled Python and downloaded an older version (3.8).
Thanks anyways :)

h5py install error failed with exit status 2

I am using Windows 7 and Python 2.7.9. I tried to install h5py with pip, but have the following error:
[c:\users\dell\appdata\local\temp\pip-build-j2msd9\h5py\h5py\api_compat.h(27) : fatal error C1083: cannot open include file:“hdf5.h”: No such file or directory
error: command 'd:\visual studio 2008\VC\BIN\amd64\cl.exe' failed with exit status 2
things I have tried:
Reinstall Visual Studio 2008 compiler
installed some necessary modules such as modHDF5 and numpy
The error you are getting is because you have not installed HDF5, or you have not specified the directory that HDF5 has been installed into.
The simplest thing to do, is to try to install h5py with a modern pip which supports wheels (e.g. run python.exe -m pip install -U pip, and then try reinstalling h5py).
If you want to build from source on Windows, see http://docs.h5py.org/en/latest/build.html#source-installation-on-windows, but I strongly recommend using wheels on Windows (as the person who wrote said CI scripts).
I changed the version of h5py to 2.9.0 and it worked like a charm
Please check what version is installed along with Pre-built package.

h5py installment error: cannot find -lhdf5

I am trying to install the keras package for python on a openSUSE server where I don't have root access. According to the instructions, I should install numpy, scipy, pyyaml, Theano, HDF5 and h5py. The server already has numpy and spicy, I installed pyyaml and Theano using "pip install XXX --user".
I downloaded HDF5 source and installed it by running the ./configure, and it was installed successfully, under folder "/home/myname/software/hdf5". Now the last step is to install h5py, where I was stuck in and can't find solutions online.
I tried:
HDF5_DIR=~/software/hdf5/ pip install h5py --user
And getting the following error:
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
cannot find -lhdf5
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
cannot find -lhdf5_hl
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Then I tried:
CFLAGS="-I/usr/lib/openmpi/include/ -I/home/myname/software/hdf5/include" LDFLAGS="-L/home/myname/software/hdf5/lib" pip install h5py --user
But getting the same error. I downloaded the source and tried:
HDF5_DIR=~/software/hdf5/ python setup.py install --user
But still getting the same error. It seems that the installer is not trying to look for things in my customized hdf5 folder. Could you help me on this? Thank you very much!

Categories