Forget PIP, Conda, and requirements.txt! Use Poetry Instead And Thank Me Later

<p>Library A requires Python 3.6. Library B relies on Library A but needs Python 3.9, and Library C depends on Library B but requires the specific version of Library A that is compatible with Python 3.6.</p> <p>Welcome to dependency hell!</p> <p>Since native Python is rubbish without external packages for data science, data scientists can often find themselves trapped in catch-22 dependency situations like the one above.</p> <p>Tools like PIP, Conda, or the laughable requirements.txt files can&rsquo;t solve this problem. Actually, dependency nightmares exist largely&nbsp;<em>because of them</em>.&nbsp;So, to end their suffering, the Python open-source community developed the charming tool known as Poetry.</p> <p>Poetry is an all-in-one project and dependency management framework with over 25k stars on GitHub. This article will introduce Poetry and list the problems it solves for data scientists.</p> <p>Let&rsquo;s get started.</p> <h2>Installation</h2> <p>While Poetry can be installed as a library with PIP, it is recommended to install it system-wide so you can call&nbsp;<code>poetry</code>&nbsp;on the CLI anywhere you like. Here is the command that runs the installation script for Unix-like systems, including&nbsp;<a href="https://towardsdatascience.com/how-to-create-perfect-machine-learning-development-environment-with-wsl2-on-windows-10-11-2c80f8ea1f31" rel="noopener" target="_blank">Windows WSL2</a>:</p> <p><a href="https://pub.towardsai.net/forget-pip-conda-requirements-txt-use-poetry-instead-and-thank-me-later-226a0bc38a56"><strong>Visit Now</strong></a></p>
Tags: Pip Conda