1

我正在尝试在我的 Ubuntu(20.04 LTS)机器上安装 tensorflow 1.14.0。我需要python 2.7版。

我试图执行的 cmd 行是

$ sudo python2.7 -m pip install tensorflow==1.14.0

但似乎“grpcio”存在问题。输出如下:

Collecting tensorflow==1.14.0
  Using cached tensorflow-1.14.0-cp27-cp27mu-manylinux1_x86_64.whl (109.2 MB)
Collecting backports.weakref>=1.0rc1
  Using cached backports.weakref-1.0.post1-py2.py3-none-any.whl (5.2 kB)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python2.7/dist-packages (from tensorflow==1.14.0) (1.1.2)
Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python2.7/dist-packages (from tensorflow==1.14.0) (1.16.0)
Collecting gast>=0.2.0
  Using cached gast-0.5.3.tar.gz (23 kB)
Collecting grpcio>=1.8.6
  Using cached grpcio-1.41.1.tar.gz (21.2 MB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0d4Nnx/grpcio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0d4Nnx/grpcio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-zkUeEF
         cwd: /tmp/pip-install-0d4Nnx/grpcio/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-0d4Nnx/grpcio/setup.py", line 256, in <module>
        if check_linker_need_libatomic():
      File "/tmp/pip-install-0d4Nnx/grpcio/setup.py", line 206, in check_linker_need_libatomic
        stderr=PIPE)
      File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
        errread, errwrite)
      File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
        raise child_exception
    OSError: [Errno 2] No such file or directory
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我已经尝试升级 pip (20.3.4) 和 setuptools (44.1.1)。我还尝试按照本指南https://pypi.org/project/grpcio/从存储库安装 grpcio ,但我得到了同样的错误。

你有什么建议吗?谢谢!

4

1 回答 1

0

我和你有同样的 exat 问题,升级 pip 在我的情况下也不起作用。

我可以通过安装旧版本的 grpcio(在我的情况下为 pip install grpcio==1.20.1)在我的平台上安装 tensorboard。

你会在执行时看到一些关于缺少动态库的警告,这对我来说没问题,但你可能想尝试其他 grpcio 版本。

于 2022-02-14T17:42:25.137 回答