Poetry installation in Windows doesn't work

Viewed 3677

Whenever I try to run poetry install on powershell inside a git repo, I keep getting this weird error, I really don't know what that might be. I am using Windows 10 and Python 3.10.0, when I try on Linux it runs normaly.

Creating virtualenv manim-tx2tvM36-py3.10 in C:\Users\ricci\AppData\Local\pypoetry\Cache\virtualenvs
Installing dependencies from lock file
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.

Package operations: 120 installs, 0 updates, 0 removals

  • Installing attrs (21.2.0)
  • Installing six (1.16.0)

  ValueError

  File \C:\Users\ricci\AppData\Local\pypoetry\Cache\artifacts\f9\2e\54\025dd026b70173a331f1335fa6d1329f5993b949c2f3d623bdda20bf1f\attrs-21.2.0-py2.py3-none-any.whl does not exist

  at ~\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\core\packages\file_dependency.py:40 in __init__
       36│             except FileNotFoundError:
       37│                 raise ValueError("Directory {} does not exist".format(self._path))
       38│
       39│         if not self._full_path.exists():
    →  40│             raise ValueError("File {} does not exist".format(self._path))
       41│
       42│         if self._full_path.is_dir():
       43│             raise ValueError("{} is a directory, expected a file".format(self._path))
       44│


  ValueError

  File \C:\Users\ricci\AppData\Local\pypoetry\Cache\artifacts\89\b2\f8\fd92b6d5daa0f8889429b2fc67ec21eedc5cae5d531ee2853828ced6c7\six-1.16.0-py2.py3-none-any.whl does not exist

  at ~\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\core\packages\file_dependency.py:40 in __init__
       36│             except FileNotFoundError:
       37│                 raise ValueError("Directory {} does not exist".format(self._path))
       38│
       39│         if not self._full_path.exists():
    →  40│             raise ValueError("File {} does not exist".format(self._path))
       41│
       42│         if self._full_path.is_dir():
       43│             raise ValueError("{} is a directory, expected a file".format(self._path))
       44│

How could I solve this error? I already break my head trying to solve it, I did a lot of research, asked to some people, and nothing seems to work.

1 Answers

Try poetry update, that solved my issue.

As described in the question, the poetry install command was not working properly. It was throwing an error: attrs-21.2.0-py2.py3-none-any.whl does not exist. I tried deleting the Poetry cache as recommended in this issue. I also tried downgrading my current Poetry installation and that didn't work either. So as a last attempt, I downloaded install-poetry.py from the Poetry Github page, ran python install-poetry.py --preview and then, inside my repo, I ran poetry update and that worked. I finally have Poetry installed.

Related