我想把Tensorflow Federated安装在带有苹果硅M1的M1上。
我尝试过用pyenv安装Python3.9.1并创建一个虚拟环境。然后我安装了包裹。
pip install tensorflow-federated安装Tensorflow Federated时由于依赖关系冲突而引发的一些错误。您可以在下面看到部分错误日志:
...
clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/readline/include -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -Ibuild/src.macosx-11.2-arm64-3.9/numpy/core/src/umath -Ibuild/src.macosx-11.2-arm64-3.9/numpy/core/src/npymath -Ibuild/src.macosx-11.2-arm64-3.9/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-11.2-arm64-3.9/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Users/user/projects/ucloud/federated/venv/include -I/Users/user/.pyenv/versions/3.9.1/include/python3.9 -Ibuild/src.macosx-11.2-arm64-3.9/numpy/core/src/common -Ibuild/src.macosx-11.2-arm64-3.9/numpy/core/src/npymath -c numpy/core/src/multiarray/array_assign_scalar.c -o build/temp.macosx-11.2-arm64-3.9/numpy/core/src/multiarray/array_assign_scalar.o -MMD -MF build/temp.macosx-11.2-arm64-3.9/numpy/core/src/multiarray/array_assign_scalar.o.d -faltivec -I/System/Library/Frameworks/vecLib.framework/Headers" failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/15/fb/86d26128a5ea42d20f402109e76a63e59845d73171887a08a43a28b847dc/h5py-3.0.0.tar.gz#sha256=7d3803be1b530c68c2955faba726dc0f591079b68941a0c0269b5384a42ab519 (from https://pypi.org/simple/h5py/) (requires-python:>=3.6). Command errored out with exit status 1: /Users/user/projects/ucloud/federated/venv/bin/python /Users/user/projects/ucloud/federated/venv/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/14/3fhr7hps0yvfd43qp60rbw480000gn/T/pip-build-env-9ws6euzt/normal --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'numpy==1.12; python_version == "3.6"' pkgconfig 'numpy==1.19.3; python_version >= "3.9"' 'numpy==1.14.5; python_version == "3.7"' 'numpy==1.17.5; python_version == "3.8"' 'Cython>=0.29.14; python_version >= "3.8"' 'Cython>=0.29; python_version < "3.8"' Check the logs for full command output.
ERROR: Cannot install tensorflow-federated==0.1.0, tensorflow-federated==0.10.0, tensorflow-federated==0.10.1, tensorflow-federated==0.11.0, tensorflow-federated==0.12.0, tensorflow-federated==0.13.0, tensorflow-federated==0.13.1, tensorflow-federated==0.14.0, tensorflow-federated==0.15.0, tensorflow-federated==0.16.0, tensorflow-federated==0.16.1, tensorflow-federated==0.17.0, tensorflow-federated==0.18.0, tensorflow-federated==0.2.0, tensorflow-federated==0.3.0, tensorflow-federated==0.4.0, tensorflow-federated==0.5.0, tensorflow-federated==0.6.0, tensorflow-federated==0.7.0 and tensorflow-federated==0.9.0 because these package versions have conflicting dependencies.
The conflict is caused by:
tensorflow-federated 0.18.0 depends on tensorflow~=2.4.0
tensorflow-federated 0.17.0 depends on tensorflow-addons~=0.11.1
tensorflow-federated 0.16.1 depends on tensorflow~=2.2.0
tensorflow-federated 0.16.0 depends on tensorflow~=2.2.0
tensorflow-federated 0.15.0 depends on tensorflow~=2.2.0
tensorflow-federated 0.14.0 depends on tensorflow~=2.2.0
tensorflow-federated 0.13.1 depends on tensorflow~=2.1.0
tensorflow-federated 0.13.0 depends on tensorflow~=2.1.0
tensorflow-federated 0.12.0 depends on tensorflow-addons~=0.7.0
tensorflow-federated 0.11.0 depends on tensorflow~=2.0.0
tensorflow-federated 0.10.1 depends on tensorflow-addons~=0.6.0
tensorflow-federated 0.10.0 depends on tensorflow-addons~=0.6.0
tensorflow-federated 0.9.0 depends on tfa-nightly
tensorflow-federated 0.7.0 depends on tf-nightly
tensorflow-federated 0.6.0 depends on tf-nightly
tensorflow-federated 0.5.0 depends on tf-nightly
tensorflow-federated 0.4.0 depends on tensorflow~=1.13
tensorflow-federated 0.3.0 depends on tensorflow~=1.13
tensorflow-federated 0.2.0 depends on tensorflow~=1.13
tensorflow-federated 0.1.0 depends on tensorflow>=1.13.0rc2
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies我想这是因为一些必需的软件包还没有准备好用ARM架构来满足苹果硅M1吗?我说的对吗?
现在有什么解决方案可以将Tensorflow Federated安装在带有苹果硅macOS的M1上?
2021年3月20日编辑:
通过跟踪这一赞扬,解决了numpy问题。
但依赖冲突仍然存在。
Preparing wheel metadata ... done
Collecting h5py
Using cached h5py-3.2.1.tar.gz (368 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... |^[[-^[[done
Preparing wheel metadata ... done
ERROR: Cannot install tensorflow-federated==0.1.0, tensorflow-federated==0.10.0, tensorflow-federated==0.10.1, tensorflow-federated==0.11.0, tensorflow-federated==0.12.0, tensorflow-federated==0.13.0, tensorflow-federated==0.13.1, tensorflow-federated==0.14.0, tensorflow-federated==0.15.0, tensorflow-federated==0.16.0, tensorflow-federated==0.16.1, tensorflow-federated==0.17.0, tensorflow-federated==0.18.0, tensorflow-federated==0.2.0, tensorflow-federated==0.3.0, tensorflow-federated==0.4.0, tensorflow-federated==0.5.0, tensorflow-federated==0.6.0, tensorflow-federated==0.7.0 and tensorflow-federated==0.9.0 because these package versions have conflicting dependencies.
The conflict is caused by:
tensorflow-federated 0.18.0 depends on tensorflow~=2.4.0
tensorflow-federated 0.17.0 depends on tensorflow~=2.3.0
tensorflow-federated 0.16.1 depends on tensorflow-addons~=0.10.0
tensorflow-federated 0.16.0 depends on tensorflow-addons~=0.10.0
tensorflow-federated 0.15.0 depends on tensorflow-addons~=0.10.0
tensorflow-federated 0.14.0 depends on tensorflow-addons~=0.9.1
tensorflow-federated 0.13.1 depends on tensorflow~=2.1.0
tensorflow-federated 0.13.0 depends on tensorflow~=2.1.0
tensorflow-federated 0.12.0 depends on tensorflow~=2.1.0
tensorflow-federated 0.11.0 depends on tensorflow-addons~=0.6.0
tensorflow-federated 0.10.1 depends on tensorflow-addons~=0.6.0
tensorflow-federated 0.10.0 depends on tensorflow-addons~=0.6.0
tensorflow-federated 0.9.0 depends on tfa-nightly
tensorflow-federated 0.7.0 depends on tf-nightly
tensorflow-federated 0.6.0 depends on tf-nightly
tensorflow-federated 0.5.0 depends on tf-nightly
tensorflow-federated 0.4.0 depends on tensorflow~=1.13
tensorflow-federated 0.3.0 depends on tensorflow~=1.13
tensorflow-federated 0.2.0 depends on tensorflow~=1.13
tensorflow-federated 0.1.0 depends on tensorflow>=1.13.0rc2
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies发布于 2022-05-31 19:26:27
我设法在Python3.9.13上安装了tensorflow-federated==0.24。以下是几个步骤:
conda install tensorflowpip install tensorflow-metal (用于M1 GPU支持)conda install scipy=1.5.3grpcio的问题,请在当前终端中输入以下标志export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1pip install tensorflow-federated (应该正确构建一切,它应该安装版本0.24.0,而不是0.1.0)conda install jax --force-reinstallhttps://stackoverflow.com/questions/66705900
复制相似问题