npx create-next-app nextjs-fastapi --example "https://github.com/digitros/nextjs-fastapi"
cd nextjs-fastapi
npm run dev
produces the following error / localhost:8000/docs isn’t accessible
[1] > pip3 install -r requirements.txt && python3 -m uvicorn api.index:app --reload
[1] error: externally-managed-environment
[1]
[1] × This environment is externally managed
[1] ╰─> To install Python packages system-wide, try brew install
[1] xyz, where xyz is the package you are trying to
[1] install.
[1]
[1] If you wish to install a non-brew-packaged Python package,
[1] create a virtual environment using python3 -m venv path/to/venv.
[1] Then use path/to/venv/bin/python and path/to/venv/bin/pip.
[1]
[1] If you wish to install a non-brew packaged Python application,
[1] it may be easiest to use pipx install xyz, which will manage a
[1] virtual environment for you. Make sure you have pipx installed.
[1]
[1] note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
running
produces the following error / localhost:8000/docs isn’t accessible
[1] > pip3 install -r requirements.txt && python3 -m uvicorn api.index:app --reload [1] error: externally-managed-environment [1] [1] × This environment is externally managed [1] ╰─> To install Python packages system-wide, try brew install [1] xyz, where xyz is the package you are trying to [1] install. [1] [1] If you wish to install a non-brew-packaged Python package, [1] create a virtual environment using python3 -m venv path/to/venv. [1] Then use path/to/venv/bin/python and path/to/venv/bin/pip. [1] [1] If you wish to install a non-brew packaged Python application, [1] it may be easiest to use pipx install xyz, which will manage a [1] virtual environment for you. Make sure you have pipx installed. [1] [1] note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.