Asif Rahman

Python project setup

Posted on 2022-03-08

The environment.yml file is used to setup the python version and essential packages.

name: NAME
  - conda-forge
  - defaults
  - python=3.9
  - pip
  - black
  - poetry

Poetry is a package manager for Python that creates a pyproject.toml file with a list of dependencies. Create a new poetry file and add packages with:

poetry init
poetry add PACKAGENAME

Install packages with Poetry after creating the virtual environment and activating it.

conda env create -f environment.yml
conda activate NAME
poetry install