Search code examples
pythonvirtualenvpython-poetry

Poetry issue with pyproject.toml "Poetry could not find a pyproject.toml file in D:\..."


I am trying to create a virtual environment with poetry, following the instructions given in Poetry Basic Usage

My problem is the following:

I use the script: poetry new poetry-demo

And this automatically and successfully creates the folder for the poetry-demo, you can see it in the attached image.

Poetry-Demo Folder

But, when I go to the next step which is to add new dependencies, in this case: poetry add pendulum, I get the following error.

"Poetry could not find a pyproject.toml file in D:..."

I've searched and I can't find why it's failing me if I'm following the steps explained in the Poetry documentation and obviously the "pyproject.toml" is there.

In case you wonder, my version of poetry is 1.1.13


Solution

  • Ok, I already figured it out, I was not on the same folder.

    I just had to change of directory to get inside the correct folder where I had the "pyproject.toml".

    Hope this helps anyone with the same issue in the future.