-
Install pyenv https://github.com/pyenv/pyenv
> curl https://pyenv.run | bash > > nano .bashrc # Add to .bashrc export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)" -
Install poetry https://python-poetry.org/docs/#installation
> curl -sSL https://install.python-poetry.org | python3 - > nano .bashrc # Add export PATH="/home/panos/.local/bin:$PATH
Install required Python version:
pyenv install -l
pyenv --version
pyenv install 3.9.17
pyenv local 3.9.17
pyenv versions
Configure Poetry to create the virtual environment in the project root:
> poetry --version
> poetry config virtualenvs.in-project true
Start poetry and follow the prompts
poetry init
Install all the dependencies with a single command:
poetry installActivate the virtual environment
poetry check
poetry shellAdd Jupyter notebook support and add virtual environment as kernel
> poetry add --group dev ipykernel
> jupyter kernelspec list
> poetry run python -m ipykernel install --name=.venv --user
-
Install
pyenvhttps://github.com/pyenv/pyenv andpoetryhttps://python-poetry.org/docs/#installation on your machine. -
Install the appropriate Python version:
cd ./email-classifier-ai pyenv install 3.9.16 pyenv local 3.9.16 -
Configure Poetry to create the virtual environment in the project root:
poetry config virtualenvs.in-project true -
Install all the dependencies with a single command:
poetry install -
Activate the virtual environment
poetry shell -
Run the server
uvicorn src.main:app --reload
The API is live at http://localhost:8000.