简体   繁体   English

无法在 Apple M1 芯片上安装 google-cloud-aiplatform - 在 grpcio 上失败

[英]Can't install google-cloud-aiplatform on Apple M1 silicon - Fails on grpcio

Trying to install google-cloud-aiplatform on a Macbook with the M1 Pro chip and it gets stuck trying to install the grpcio dependency.尝试在带有 M1 Pro 芯片的 Macbook 上安装google-cloud-aiplatform时,尝试安装grpcio依赖项时卡住了。

I am running pip install google-cloud-aiplatform from a Miniforge environment running python 3.9.13.我在运行 python 3.9.13 的 Miniforge 环境中运行pip install google-cloud-aiplatform aiplatform。

The error trace is massive, and I can edit to share more if needed but the last few lines say:错误跟踪很大,如果需要,我可以编辑以共享更多信息,但最后几行说:

error: legacy-install-failure

× Encountered error while trying to install package.
╰─> grpcio

note: This is an issue with the package mentioned above, not pip.

Thanks谢谢

Fixed this annoying issue by using pyenv (with python 3.10) rather than Miniforge and installing version 1.44.0 of grpcio before google-cloud-aiplatform .通过使用pyenv (使用 python 3.10)而不是Miniforge并在google-cloud-aiplatform grpcio安装 grpcio 1.44.0 版本,解决了这个烦人的问题。 I do not know why this works, so if anybody can shed some light into it that would be great!我不知道为什么会这样,所以如果有人能对此有所了解,那就太好了! But if you need to get it working and are ok using pyenv then below are the steps I took (I used brew to install pyenv ):但是如果你需要让它工作并且可以使用pyenv那么下面是我采取的步骤(我使用brew来安装pyenv ):

  • Install brew and follow the instructions to update your PATH etc.安装brew并按照说明更新您的 PATH 等。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Install pyenv and set python version 3.10.3 as the global version:安装 pyenv 并将 python 版本3.10.3设置为全局版本:
brew install pyenv
pyenv global 3.10.3
  • (Optional) Use pyenv-virtualenv to create your environment: (可选)使用pyenv-virtualenv创建您的环境:
brew install pyenv-virtualenv
pyenv virtualenv 3.10.3 your_env_name
pyenv activate your_env_name
  • Upgrade pip and install grpcio :升级 pip 并安装grpcio
pip install --upgrade pip
pip install -v https://files.pythonhosted.org/packages/65/75/8b706e1170e2c7b6242b1675259e47986bb4fc490f29387989a965972e6e/grpcio-1.44.0.tar.gz
  • Install google-cloud-aiplatform :安装google-cloud-aiplatform
pip install google-cloud-aiplatform

Hope this helps!希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM