最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Unable to install tensorflow-federated on M2 Macbook - Stack Overflow

programmeradmin4浏览0评论

I am currently facing a really frustrating problem with installing tensorflow federated. I am on M2 Macbook Air, using virtual env, no conda.

I was following this tutorial, and did the following:

  1. Created a new folder
  2. Set the local Python versoion to: pyenv local 3.13.2
  3. Created a new environment with: python -m venv tff-venv
  4. Upgraded pip with: pip install --upgrade "pip"
  5. Tried to install tensorflow federated with: pip install --upgrade tensorflow-federated

I got this error:

Collecting absl-py~=0.9.0 (from tensorflow-federated)
  Using cached absl-py-0.9.0.tar.gz (104 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
....
....
File "<string>", line 34, in <module>
      RuntimeError: Python version 2.7 or 3.4+ is required.
      [end of output]

After that I googled a bit, and found out that the package apparently thinks that python 3.13 is less than 3.4, because it compares string.

Thus, I deleted the venv, and then set the local python version to 3.9.15 (Step 2) and followed the rest of the steps. However, I again got an error while trying to pip install tensorflow-federated:

...
ModuleNotFoundError: No module named 'distutils.msvccompiler'
...

Thus, I am bit stuck as I have no clue what could be wrong and how I could fix it. I would be grateful for any help!

I am currently facing a really frustrating problem with installing tensorflow federated. I am on M2 Macbook Air, using virtual env, no conda.

I was following this tutorial, and did the following:

  1. Created a new folder
  2. Set the local Python versoion to: pyenv local 3.13.2
  3. Created a new environment with: python -m venv tff-venv
  4. Upgraded pip with: pip install --upgrade "pip"
  5. Tried to install tensorflow federated with: pip install --upgrade tensorflow-federated

I got this error:

Collecting absl-py~=0.9.0 (from tensorflow-federated)
  Using cached absl-py-0.9.0.tar.gz (104 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
....
....
File "<string>", line 34, in <module>
      RuntimeError: Python version 2.7 or 3.4+ is required.
      [end of output]

After that I googled a bit, and found out that the package apparently thinks that python 3.13 is less than 3.4, because it compares string.

Thus, I deleted the venv, and then set the local python version to 3.9.15 (Step 2) and followed the rest of the steps. However, I again got an error while trying to pip install tensorflow-federated:

...
ModuleNotFoundError: No module named 'distutils.msvccompiler'
...

Thus, I am bit stuck as I have no clue what could be wrong and how I could fix it. I would be grateful for any help!

Share Improve this question asked 21 hours ago ricky11ricky11 669 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

tensorflow-federated only supports POSIX :: Linux Operating System. There's no support for macOS as it only has wheels for Linux.

发布评论

评论列表(0)

  1. 暂无评论