简体   繁体   English

如何在苹果 M1 pro 上安装 azure 功能,与 Rosetta 一起安装时遇到问题

[英]how to install azure functions on apple M1 pro, facing issues when installed with Rosetta

I just had my first Mac book but that too with M1 processor and since then I am struggling with software compatibility issues.我刚刚有了我的第一本 Mac 书,但它也使用了 M1 处理器,从那时起我就一直在为软件兼容性问题而苦苦挣扎。

Considering that I dont have much experience with Mac, I really need some help in resolving this issue.考虑到我对 Mac 没有太多经验,我真的需要一些帮助来解决这个问题。

I want to run azure functions on VS Code locally and for that, I need python, VS Code and azure tools but I kept on getting errors saying that Architecture ARM is not supported for language python. I want to run azure functions on VS Code locally and for that, I need python, VS Code and azure tools but I kept on getting errors saying that Architecture ARM is not supported for language python.

I tried with python 3.8, 3.9 and 3.10 (3.10 was not accepted by VS Code.)我尝试使用 python 3.8、3.9 和 3.10(VS Code 不接受 3.10。)

So, now what I understand is that using Rosetta, we can use the same softwares which we use on intel processor, so I followed below protocol for that.所以,现在我明白的是,使用 Rosetta,我们可以使用我们在英特尔处理器上使用的相同软件,所以我遵循以下协议。

  1. installed Rosetta: /usr/sbin/softwareupdate --install-rosetta安装 Rosetta:/usr/sbin/softwareupdate --install-rosetta
  2. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh )" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh )"
  3. cd ~/Downloads cd ~/下载
  4. mkdir homebrew mkdir 自制软件
  5. curl -L https://github.com/Homebrew/brew/tarball/master | curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew tar xz --strip 1 -C 自制软件
  6. sudo mv homebrew /usr/local/homebrew sudo mv homebrew /usr/local/homebrew
  7. export PATH=$HOME/bin:/usr/local/bin:$PATH导出 PATH=$HOME/bin:/usr/local/bin:$PATH
  8. Let's add an alias and path in the ~/.zshrc file:让我们在 ~/.zshrc 文件中添加别名和路径:

-If you come from bash you might have to change your $PATH. - 如果您来自 bash,您可能需要更改 $PATH。

-need this for x86_64 brew -x86_64 brew 需要这个

export PATH=$HOME/bin:/usr/local/bin:$PATH alias axbrew='arch -x86_64 /usr/local/homebrew/bin/brew'导出 PATH=$HOME/bin:/usr/local/bin:$PATH 别名 axbrew='arch -x86_64 /usr/local/homebrew/bin/brew'

LINK I referred for this: https://medium.com/mkdir-awesome/how-to-install-x86-64-homebrew-packages-on-apple-m1-macbook-54ba295230f链接我为此推荐: https://medium.com/mkdir-awesome/how-to-install-x86-64-homebrew-packages-on-apple-m1-macbook-54ba295230f

  1. Now you can install apps for Intel processors: axbrew install package-name现在您可以为英特尔处理器安装应用程序:axbrew install package-name

so, now I thought I am finally done.所以,现在我想我终于完成了。

  1. I installed python -> axbrew install python@3.9我安装了 python -> axbrew install python@3.9
  2. I downloaded VS Code Universal.我下载了 VS Code Universal。
  3. ran the function, it threw error for "you must have download azure function core tools".运行 function,它抛出错误“你必须下载 azure function 核心工具”。 Used below commands to download it:使用以下命令下载它: -[![在此处输入图像描述][1]][1] [![在此处输入图像描述][2]][2]

but still I keep getting this error from VS Code.但我仍然不断从 VS Code 收到此错误。 VS code doesnt recognize the azure tools functions I installed. VS 代码无法识别我安装的 azure 工具功能。

I tried with VSCode universal, for intel etc, but still the same.我尝试使用 VSCode 通用,用于英特尔等,但仍然相同。

Any leads on why I am facing this issue and how to come out of it.关于我为什么面临这个问题以及如何摆脱它的任何线索。

VS 代码错误

After all the research, I was able to solve this problem by uninstalling the azure tools which I installed thorugh home brew, and installing through npm.经过所有的研究,我能够通过卸载我通过 home brew 安装的 azure 工具并通过 npm 安装来解决这个问题。 this solved my problem.这解决了我的问题。 I am not sure why but it did.我不知道为什么,但确实如此。 below are the steps i used.以下是我使用的步骤。 在此处输入图像描述

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

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