i am running into an error when i try to install tensor flow using pip on my raspberry pi 3b+.

here is the error message:

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-p4UFOu/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-ofsmSC/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-p4UFOu/h5py/

here are the commands i have tried with the same results:

pip install tensorflow

sudo pip install tensorflow

sudo -H install tensorflow

pip install --user tensorflow

i am running the latest version of Raspbian OS and have updated and upgraded my raspberry pi. i am also using python 2.7 and this works successfully with python 2.7 on my ubuntu 18.10 laptop.

any ideas how i can successfully do this?

UPDATE: sorry the error message long scrolls. i tried to make it more readable for everyone.

  • could you possibly make the error message and the commands you tried to use readable? – Jaromanda X Jan 4 at 7:59
  • @JaromandaX please look at the edit changes and give me your input and let me know if this is more readable. thanks for your suggestion by the way. – ironmantis7x Jan 4 at 8:12
  • The error message was more readable before. But what exact series of commands leads to that output? When you say here are the commands I have tried with the same results, does that mean all 4 of those give the same error? When you say you've updated and upgraded, what commands do you mean? – T. M. Jan 4 at 14:08
  • 1
    On Raspbian Stretch use pip3 to installed pre-compiled modules (wheels). There are no pre-compiled versions for Python 2 available at the moment. You can compile it yourself, but it will take hours... – Dirk Jan 4 at 15:52
  • @T.M. anyone of those actually gives the same error – ironmantis7x Jan 4 at 16:26

Your Answer

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

Browse other questions tagged or ask your own question.