Я работаю в оболочке MSYS2 MinGW x64.
У меня установлено следующее с помощью команд:
Код: Выделить всё
pacman -S mingw-w64-x86_64-python
pacman -S mingw-w64-x86_64-python-pip
pacman -S mingw-w64-x86_64-python-fastapi
Код: Выделить всё
pip install fastapi
Код: Выделить всё
imelf@FLORI-LENOVO-93 MINGW64 /c/Users/imelf/Documents/NachhilfeInfoUni/Kadala/Pybind11
$ pip install fastapi
Requirement already satisfied: fastapi in c:/software/msys64/mingw64/lib/python3.11/site-packages (0.109.0)
Requirement already satisfied: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,=1.7.4 in c:/software/msys64/mingw64/lib/python3.11/site-packages (from fastapi) (2.5.3)
Requirement already satisfied: starlette=0.35.0 in c:/software/msys64/mingw64/lib/python3.11/site-packages (from fastapi) (0.35.0)
Requirement already satisfied: typing-extensions>=4.8.0 in c:/software/msys64/mingw64/lib/python3.11/site-packages (from fastapi) (4.9.0)
Requirement already satisfied: annotated-types>=0.4.0 in c:/software/msys64/mingw64/lib/python3.11/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,=1.7.4->fastapi) (0.6.0)
Requirement already satisfied: pydantic-core==2.14.6 in c:/software/msys64/mingw64/lib/python3.11/site-packages (from pydantic!=1.8,!=1.88.1,!=2.0.0,!=2.0.1,!=2.1.0,=1.7.4->fastapi) (2.14.6)
Requirement already satisfied: anyio=3.4.0 in c:/software/msys64/mingw64/lib/python3.11/site-packages (from starlette=0.35.0->fastapi) (4.2.0)
Requirement already satisfied: idna>=2.8 in c:/software/msys64/mingw64/lib/python3.11/site-packages (from anyio=3.4.0->starlette=0.35.0->fastapi) (3.6)
Requirement already satisfied: sniffio>=1.1 in c:/software/msys64/mingw64/lib/python3.11/site-packages (from anyio=3.4.0->starlette=0.35.0->fastapi) (1.3.0)
Код: Выделить всё
from fastapi import FastAPI
meine_coole_rest_api = FastAPI()
@meine_coole_rest_api.get("/")
async def wurzel_pfad():
return {"coole_nachricht" : "Fast API works"}
Код: Выделить всё
fastapi dev test.py
Код: Выделить всё
imelf@FLORI-LENOVO-93 MINGW64 /c/Users/imelf/Documents/NachhilfeInfoUni/Kadala/Pybind11
$ fastapi dev test.py
bash: fastapi: command not found
Подробнее здесь: https://stackoverflow.com/questions/785 ... n-on-msys2
Мобильная версия