0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【備忘録】コピペ用fastAPIセットアップ手順(プロジェクト立ち上げ時)

0
Last updated at Posted at 2026-05-11

Pythonプロジェクト立ち上げ手順

コピペで作業したい……

1: プロジェクト用ディレクトリを作成

mkdir ~/project-name

~/project-name は好きな場所・名前に置き換えてください。

2: VS Codeでターミナルを立ち上げ

cd ~/projects-name
code .

VS Codeが開いたら、`Ctrl + Shift + ``(バッククォート)またはメニューの「ターミナル > 新しいターミナル」で統合ターミナルを開きます。

3: requirements.txtを作成(FastAPI用)

touch requirement.txt

↓以下をコピペ

requirements.txt
fastapi
uvicorn
pydantic-settings
python-dotenv
pytest
ruff
pyright
pre-commit

4: venvを作成、および有効化

python3 -m venv .venv
source .venv/bin/activate

5: pip listの確認

pip list

想定される出力例

Package           Version
----------------- -------
annotated-doc     0.0.4
annotated-types   0.7.0
anyio             4.13.0
cfgv              3.5.0
click             8.3.3
distlib           0.4.0
fastapi           0.136.1
filelock          3.29.0
h11               0.16.0
identify          2.6.19
idna              3.14
iniconfig         2.3.0
nodeenv           1.10.0
packaging         26.2
pip               25.1.1
platformdirs      4.9.6
pluggy            1.6.0
pre_commit        4.6.0
pydantic          2.13.4
pydantic_core     2.46.4
pydantic-settings 2.14.1
Pygments          2.20.0
pyright           1.1.409
pytest            9.0.3
python-discovery  1.3.0
python-dotenv     1.2.2
PyYAML            6.0.3
ruff              0.15.12
starlette         1.0.0
typing_extensions 4.15.0
typing-inspection 0.4.2
uvicorn           0.46.0
virtualenv        21.3.1

バージョンは現時点(2026/05/11)のもの。ライブラリが一致するかだけを確認。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?