Tensorflow联邦安装出错

8zzbczxx  于 2023-11-21  发布在  其他
关注(0)|答案(1)|浏览(198)

我试图在Windows中使用Python 3.11在新的Anaconda环境中运行pip install tensorflow-federated来安装Tensorflow Federated,但它给了我这个错误:

Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-k_gm1isk\absl-py_2a985a0a199a4b93b9e364bfe5d6f101\setup.py", line 34, in <module>
          raise RuntimeError('Python version 2.7 or 3.4+ is required.')
      RuntimeError: Python version 2.7 or 3.4+ is required.
      [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

字符串
我试过在其他版本的python中安装它,但它只适用于python3.8,在这一点上,一些版本的库太旧了,无法工作,并出现了兼容性问题。
会感激一些帮助!
谢谢你的时间!

xwmevbvl

xwmevbvl1#

tensorflow-federated在Windows上不受支持,请参阅https://github.com/tensorflow/federated/issues/4207
很遗憾,我们目前不支持Windows。
https://github.com/tensorflow/federated/issues/779
我想很不幸的是,我们不太可能在不久的将来尝试添加windows支持,我们这边需要进行一些重要的设置,目前还没有考虑到这一点。
也就是说,像virtualbox或docker这样的解决方案(甚至可能是Linux的Windows子系统?)应该允许您在Windows机器上运行TFF,尽管可能有一些稍微粗糙的边缘。
在您的情况下,pip会返回到较旧版本的tensorflow-federated,这些版本没有明确声明它们不适用于Windows,然后在尝试构建依赖项absl-py-0.9.0.tar.gz时,tensorflow_federated-0.17会失败。在setup.py中,此包的版本检查实现为

if py_version < ('2', '7') or py_version[0] == '3' and py_version < ('3', '4')

字符串
这对python版本<3.10有效,但由于'10''4'的字符串比较结果为“10”<“4”而失败,因此出现了python版本过低的错误消息。
您的解决方案:
正如Github上的引用中提到的,通过虚拟化、Docker、WSl或双引导来使用Linux系统

相关问题