Score:1

Unable to install h5py in virtualenv with pip3

us flag

I'm a beginner having trouble installing h5py.

I'm using Ubuntu 18.04 and working in a virtualenv with pip3 and Python 3.6.9

I did the following installations in the virtualenv:

~$pip3 install -U pkgconfig

~$pip3 install -U cython

~$pip3 install -U numpy grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast

~$pip3 list –local is: absl-py 1.0.0 certifi 2021.10.8 charset-normalizer 2.0.9 Cython 0.29.25 gast 0.5.3 grpcio 1.42.0 idna 3.3 mock 4.0.3 numpy 1.19.5 pip 21.3.1 pkgconfig 1.5.5 portpicker 1.5.0 psutil 5.8.0 py-cpuinfo 8.0.0 requests 2.26.0 setuptools 58.5.3 six 1.16.0 urllib3 1.26.7 wheel 0.37.0

I then did the following installations, also in the virtualenv:

~$pip3 install -U h5py

The first error encountered was

Using cached h5py-3.1.0.tar.gz (371 kB) Installing build dependencies ... [?25l- done Getting requirements to build wheel ... [?25ldone Installing backend dependencies ... [?25l- error ERROR: Command errored out with exit status 1:

Thank you for any advise in advance.

Score:0
us flag

I found a YouTube video that solved my problem. It seems to have been something to do with first installing the correct versions of some other modules.

The YouTube video is by Islander Robotics: https://youtu.be/ynK-X5IPu1A

hr flag
Link-only answers are discouraged here - please consider updating your answer to include the essential steps necessary to fix the issue, citing the YouTube link
Score:0
zw flag

You have to install build-dependencies for the python3-h5py package.
At first you need to enable Source Code repositories in Software & Updates (software-properties-gtk) and then run below commands:

sudo apt-get update
sudo apt-get build-dep python3-h5py

then retry h5py installation by pip3.

James Canova avatar
us flag
Thnak you for the very clear instructions. Unfortunately, the identical error results. If it is relevant the contents of pyvenv.cfg is: home = /usr implementation = CPython version_info = 3.6.9.final.0 virtualenv = 20.10.0 include-system-site-packages = false base-prefix = /usr base-exec-prefix = /usr base-executable = /usr/bin/python3
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.