Ubuntu Remote 192.168.1.8
Dev/dev_python/lab/learn
hello.py
main.py
Create .venv python3.8
.venv
ubuntu@pi4b:~$ /home/ubuntu/.venv/bin/python /home/ubuntu/Dev/dev_python/lab/learn/hello.py
Hello, World!
pip install fastapi
Requirement already satisfied: idna>=2.8 in /usr/lib/python3/dist-packages (from anyio<5,>=3.4.0->starlette<0.47.0,>=0.40.0->fastapi) (2.8)
Collecting exceptiongroup>=1.0.2; python_version < "3.11"
Downloading exceptiongroup-1.3.0-py3-none-any.whl (16 kB)
Installing collected packages: typing-extensions, pydantic-core, annotated-types, pydantic, sniffio, exceptiongroup, anyio, starlette, fastapi
WARNING: The script fastapi is installed in '/home/ubuntu/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed annotated-types-0.7.0 anyio-4.5.2 exceptiongroup-1.3.0 fastapi-0.115.12 pydantic-2.10.6 pydantic-core-2.27.2 sniffio-1.3.1 starlette-0.44.0 typing-extensions-4.13.2
(.venv) ubuntu@pi4b:~/Dev/dev_python/lab/learn$ pip install fastapi
Collecting fastapi
Downloading fastapi-0.115.12-py3-none-any.whl.metadata (27 kB)
Successfully installed annotated-types-0.7.0 anyio-4.5.2 exceptiongroup-1.3.0 fastapi-0.115.12 idna-3.10 pydantic-2.10.6 pydantic-core-2.27.2 sniffio-1.3.1 starlette-0.44.0 typing-extensions-4.13.2
(.venv) ubuntu@pi4b:~/Dev/dev_python/lab/learn$ pip install "fastapi[standard]"
Successfully installed MarkupSafe-2.1.5 certifi-2025.4.26 click-8.1.8 dnspython-2.6.1 email-validator-2.2.0 fastapi-cli-0.0.7 h11-0.16.0 httpcore-1.0.9 httptools-0.6.4 httpx-0.28.1 jinja2-3.1.6 markdown-it-py-3.0.0 mdurl-0.1.2 pygments-2.19.1 python-dotenv-1.0.1 python-multipart-0.0.20 pyyaml-6.0.2 rich-14.0.0 rich-toolkit-0.14.7 shellingham-1.5.4 typer-0.16.0 uvicorn-0.33.0 uvloop-0.21.0 watchfiles-0.24.0 websockets-13.1
(.venv) ubuntu@pi4b:~/Dev/dev_python/lab/learn$ fastapi dev main.py
FastAPI Starting development server 🚀
Searching for package file structure from directories with __init__.py files
Importing from /home/ubuntu/Dev/dev_python/lab/learn
module 🐍 main.py
code Importing the FastAPI app object from the module with the following code:
from main import app
app Using import string: main:app
server Server started at http://127.0.0.1:8000
server Documentation at http://127.0.0.1:8000/docs
tip Running in development mode, for production use: fastapi run
Logs:
INFO Will watch for changes in these directories: ['/home/ubuntu/Dev/dev_python/lab/learn']
INFO Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO Started reloader process [81986] using WatchFiles
INFO Started server process [82001]
INFO Waiting for application startup.
INFO Application startup complete.
INFO 127.0.0.1:51516 - "GET / HTTP/1.1" 200
INFO 127.0.0.1:51516 - "GET /favicon.ico HTTP/1.1" 404