'Running fastAPI app in Anaconda3 on M1 Macbook
I am using Anaconda3 to run a FastAPI app, it ran well until I updated my OS. Now every time I run:
uvicorn main:app
It always shows this error:
illegal hardware instruction uvicorn main:app
I searched on Google and found this kind of error in Tensorflow, it relates to M1 chip. Is there any way to fix this problem? Or do I have to revert my OS version? Many thanks.
I tried to reinstall Anaconda3 from scratch many times but it still not working. Here is my current macOS version.
Solution 1:[1]
I assume you are using Anaconda in rosetta mode (Intel mode in M1). You need Python and libraries compiled in ARM to avoid this issues. Remove existing Anaconda installation and install Miniconda Apple M1 version: Miniconda3 macOS Apple M1 64-bit bash
I use FastAPI without problems in my macbook.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Yuri Niitsuma |

