How to set up your Python projects with conda and poetry
At my current job we use conda to manage our environments and poetry to manage our packages. I have to say that the setup is pretty sweet and wanted to share it with you guys.
Imagine that we are working on a generic project called project-name
then the
setup is as follows
conda create --name project-name python=3.7
conda activate project-name
pip install poetry
poetry config virtualenvs.create false
poetry install --no-root
ipython kernel install --name "project-name" --user
This initialises a conda
environment with a name and the correct python version,
installs poetry
using pip, and then installs and manages your packages through
poetry
, finally it installs a jupyter kernel with the same name.
Just change project-name
to the name of your repo and you’re all set!
Comments