Search code examples
pythonpippython-poetry

Force poetry to respect the versions in requirements.txt


The following is in the requirements.txt :

requirements.txt:packaging==20.9

But then after doing a poetry add [some unrelated pkg] We now have in the poetry.lock:

{file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"},

That is not going to work for us. How can I get poetry to listen to the requirements.txt?


Solution

  • How can I get poetry to listen to the requirements.txt?

    You cannot. Instead of using requirements.txt add your dependencies into the pyproject.toml if you use poetry.