树莓派pi4无法导入tensorflow1.14.0

问题描述

我在RaspBerry Pi 4上使用Python 3。 该版本在pyenv中,为3.5.3。 这些软件包当前已安装:

absl-py              0.9.0
astor                0.8.1
certifi              2020.6.20
chardet              3.0.4
Cython               0.29.21
gast                 0.2.2
google-pasta         0.2.0
grpcio               1.31.0
h5py                 2.10.0
idna                 2.10
importlib-Metadata   1.7.0
Keras-Applications   1.0.8
Keras-Preprocessing  1.1.2
Markdown             3.2.2
numpy                1.18.5
opencv-python        4.1.1.26
pip                  20.2.2
protobuf             3.13.0
PyYAML               5.3.1
requests             2.24.0
setuptools           39.1.0
six                  1.15.0
tensorboard          1.14.0
tensorflow           1.14.0
tensorflow-estimator 1.14.0
termcolor            1.1.0
urllib3              1.25.10
Werkzeug             1.0.1
wheel                0.35.1
wrapt                1.12.1
zipp                 1.2.0

我们使用的tensorflow软件包版本1.14.0引入了

$ pip3 install tensorflow

确认已安装

$ pip3 list

我开始

$ python3

并发布了以下导入声明:

import tensorflow as tf

但收到以下错误消息:

Python 3.5.3 (default,Aug 19 2020,22:47:25) 
[GCC 8.3.0] on linux
Type "help","copyright","credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>",line 1,in <module>
  File "/home/pi/.pyenv/versions/3.5.3/lib/python3.5/site-packages/tensorflow/__init__.py",line 28,in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/home/pi/.pyenv/versions/3.5.3/lib/python3.5/site-packages/tensorflow/python/__init__.py",line 47,in <module>
    import numpy as np
  File "/home/pi/.pyenv/versions/3.5.3/lib/python3.5/site-packages/numpy/__init__.py",line 145,in <module>
    from . import lib
  File "/home/pi/.pyenv/versions/3.5.3/lib/python3.5/site-packages/numpy/lib/__init__.py",line 27,in <module>
    from .index_tricks import *
  File "/home/pi/.pyenv/versions/3.5.3/lib/python3.5/site-packages/numpy/lib/index_tricks.py",line 13,in <module>
    import numpy.matrixlib as matrixlib
  File "/home/pi/.pyenv/versions/3.5.3/lib/python3.5/site-packages/numpy/matrixlib/__init__.py",line 6,in <module>
    from .defmatrix import *
  File "/home/pi/.pyenv/versions/3.5.3/lib/python3.5/site-packages/numpy/matrixlib/defmatrix.py",in <module>
    from numpy.linalg import matrix_power
  File "/home/pi/.pyenv/versions/3.5.3/lib/python3.5/site-packages/numpy/linalg/__init__.py",line 75,in <module>
    from .linalg import *
  File "/home/pi/.pyenv/versions/3.5.3/lib/python3.5/site-packages/numpy/linalg/linalg.py",line 35,in <module>
    from numpy.linalg import lapack_lite,_umath_linalg
ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory

如果有人可以告诉我错误原因,我会很高兴。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)