I'm following this guide to create an AI chatbot which requires Python 3.6, TensorFlow etc. So I installed Python 3.6.8.

To install TensorFlow I tried sudo pip install tensorflow

I also downloaded the .whl file and tried sudo pip install tensorflow-1.14.0-cp36-none-linux_armv7l.whl

I also tried using pip3.6 sudo pip3.6 install tensorflow-1.14.0-cp36-none-linux_armv7l.whl

All of them return the same error.

  Loading library to get version: libhdf5.so
  error: libhdf5.so: cannot open shared object file: No such file or directory

Command "/usr/local/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/ tmp/pip-install-v9ml238y/h5py/setup.py';f=getattr(tokenize, 'open', open)(__file __);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, ' exec'))" install --record /tmp/pip-record-m8i6i3k3/install-record.txt --single-v ersion-externally-managed --compile" failed with error code 1 in /tmp/pip-instal l-v9ml238y/h5py/

Sorry for any mistakes. This is my first post.

  • 1
    Try to install the library : sudo apt-get install hdf5 libhdf5-dev ? – Ephemeral Jan 4 at 21:12
  • 1
    yes but libhdf5-dev contain dev headers files. The library (.so) itself must be in a package libhdf5-X where X is the version. You can find the lib with : sudo apt-cache search libhd5 for example you can have libhdf5-100. – Ephemeral Jan 5 at 7:44
  • 1
    packages.debian.org/stretch/libhdf5-100 : HDF5 is a file format and library for storing scientific data – Ephemeral Jan 5 at 7:48
  • 1
    Hi AnonyoZarif, Welcome and nice to meet you. Ah, let me see. A couple of months ago I tried to install TF but failed because of the "failed to build h5py error" error. I am not sure if it is related to "hd5" thing mentioned by @Ephemeral. In the same Q&A, #Kor mentioned that he finally solved the problem, but I still got stuck. Anyway, I have stalled my project and waiting for google to update. Here are the links for your reference, in case you are interested. Good luck and cheers. (1) Rpi4B TensorFlow Installation Record - tlfong01 2019sep30 penzu.com/public/3970e2d0 – tlfong01 Jan 5 at 14:42
  • 1
    Thank you guys for your help and I have successfully developed my AI! – AnonyoZarif Jan 6 at 4:53

Okay, I have solved my problem. I reinstalled Python 3.6.

Then I used this command sudo apt-get install libhdf5-dev and then sudo pip install tensorflow and installed TensorFlow successfully!

I think the problem was with my Python installation.

Thanks to all of you for your kindness. Cheers!!!

| improve this answer | |
  • Yes, I did complain that GG TF installation was once wrong and misleading. They said your could not use PIP2 for Python 3, and if you did you will get a mess. But they did not said so before hand. – tlfong01 Jan 6 at 12:12
  • Yes you are right but i used pip3.6 – AnonyoZarif Jan 6 at 14:58
  • A long time ago (I can't remember when) I also tried to install TF with pip2 and as usual- it failed. – AnonyoZarif Jan 6 at 15:01
  • Please accept your answer. Otherwise it will pop up again and again for years. – Ingo Jan 7 at 20:49
  • 1
    Okay @Ingo doing it – AnonyoZarif Jan 12 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.