Warning: The lock file is not up to date with the latest changes in pyproject.toml

两盒软妹~` 提交于 2020-05-31 04:59:25

问题


When I am using a poetry command with Python 3.7, in my case:

poetry export -f requirements.txt

I am getting the following error:

Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.

So far clear, but if I run poetry update it upgrades my dependencies, which is not what I want at this time for my project. If I run poetry lock instead, it still upgrades dependencies.

How can I work around this?


回答1:


This is a known issue in Poetry.

There is a current workaround with the following commands:

poetry add pathlib2
poetry remove pathlib2

Where pathlib2 is any library you don't already depend on and that has no dependencies on it's own, hence pathlib2.

Using these commands will rewrite the lockfile hashes and resolve the file conflict without upgrading any of the other packages used in the project.



来源:https://stackoverflow.com/questions/62040724/warning-the-lock-file-is-not-up-to-date-with-the-latest-changes-in-pyproject-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!