Error when updating poetry #10540
-
I had Today, I tried to update poetry by doing poetry self update and got the following error Updating Poetry version ...
Using version ^2.1.4 for poetry
Updating dependencies
Resolving dependencies... (6.4s)
Package operations: 9 installs, 22 updates, 0 removals
- Updating certifi (2024.12.14 -> 2025.8.3)
- Installing h11 (0.16.0)
- Installing sniffio (1.3.1)
- Installing typing-extensions (4.15.0)
- Installing anyio (4.10.0)
- Updating charset-normalizer (3.4.1 -> 3.4.3)
- Installing httpcore (1.0.9)
- Updating more-itertools (10.6.0 -> 10.8.0)
- Updating urllib3 (2.3.0 -> 2.5.0)
- Updating distlib (0.3.9 -> 0.4.0)
- Updating filelock (3.16.1 -> 3.19.1)
- Installing httpx (0.28.1)
- Updating jaraco-functools (4.1.0 -> 4.3.0)
- Updating msgpack (1.1.0 -> 1.1.1)
- Updating packaging (24.2 -> 25.0)
- Updating platformdirs (4.3.6 -> 4.4.0)
- Updating rapidfuzz (3.11.0 -> 3.14.1)
- Updating requests (2.32.3 -> 2.32.5)
- Installing zstandard (0.24.0)
- Updating build (1.2.2.post1 -> 1.3.0)
- Updating cachecontrol (0.14.2 -> 0.14.3)
- Updating dulwich (0.22.7 -> 0.22.8)
- Updating fastjsonschema (2.21.1 -> 2.21.2)
- Installing findpython (0.6.3)
- Installing pbs-installer (2025.9.2)
- Updating pkginfo (1.12.0 -> 1.12.1.2)
- Updating poetry-core (2.0.1 -> 2.1.3)
- Updating tomlkit (0.13.2 -> 0.13.3)
- Updating trove-classifiers (2025.1.15.22 -> 2025.9.9.12)
- Updating virtualenv (20.29.1 -> 20.32.0)
- Updating poetry (2.0.1 -> 2.1.4): Failed
CalledProcessError
Command '['C:\\Users\\XXXXXXX\\pipx\\venvs\\poetry\\Scripts\\python.exe', 'C:\\Users\\XXXXXXX\\pipx\\venvs\\poetry\\Lib\\site-packages\\virtualenv\\seed\\wheels\\embed\\pip-24.3.1-py3-none-any.whl\\pip', 'uninstall', 'poetry', '-y']' returned non-zero exit status 2.
at ~\AppData\Local\miniforge3\Lib\subprocess.py:571 in run
567│ # We don't call process.wait() as .__exit__ does that for us.
568│ raise
569│ retcode = process.poll()
570│ if check and retcode:
→ 571│ raise CalledProcessError(retcode, process.args,
572│ output=stdout, stderr=stderr)
573│ return CompletedProcess(process.args, retcode, stdout, stderr)
574│
575│
The following error occurred when trying to handle this error:
EnvCommandError
Command ['C:\\Users\\XXXXXXX\\pipx\\venvs\\poetry\\Scripts\\python.exe', 'C:\\Users\\XXXXXXX\\pipx\\venvs\\poetry\\Lib\\site-packages\\virtualenv\\seed\\wheels\\embed\\pip-24.3.1-py3-none-any.whl\\pip', 'uninstall', 'poetry', '-y'] errored with the following return code 2
Output:
C:\Users\XXXXXXX\AppData\Local\miniforge3\python.exe: can't open file 'C:\\Users\\XXXXXXX\\pipx\\venvs\\poetry\\Lib\\site-packages\\virtualenv\\seed\\wheels\\embed\\pip-24.3.1-py3-none-any.whl\\pip': [Errno 2] No such file or directory
at ~\pipx\venvs\poetry\Lib\site-packages\poetry\utils\env\base_env.py:342 in _run
338│ output = subprocess.check_output(
339│ cmd, stderr=stderr, env=env, text=True, encoding=encoding, **kwargs
340│ )
341│ except CalledProcessError as e:
→ 342│ raise EnvCommandError(e)
343│
344│ return output
345│
346│ def execute(self, bin: str, *args: str, **kwargs: Any) -> int:
Cannot install poetry. After that, my poetry show
cannot import name 'SCHEMA_DIR' from 'poetry.core.json' (C:\Users\320271016\pipx\venvs\poetry\Lib\site-packages\poetry\core\json\__init__.py) I tried searching for other open issues and googling with no results. Does anyone have any idea what went wrong and, most importantly, how to fix it? I suppose doing a clean install might do the trick, but if possible I would like to avoid that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I am answering my own question in case anyone runs into the same issue. After many hours of googling and even some Copilot help, I couldn't solve it. Therefore, I had to go the nuclear option and install The original instructions say that
However, in my case it detected that there were already some
This installed In retrospective, this wasn't such a hassle as I thought it was going to be. I still don't know what caused the issue on the first place, though. |
Beta Was this translation helpful? Give feedback.
I am answering my own question in case anyone runs into the same issue.
After many hours of googling and even some Copilot help, I couldn't solve it. Therefore, I had to go the nuclear option and install
poetry
from scratch again. I did so usingpipx
(which is also how I installed it the first time), but I don't know if this would solve the issue if installed using other alternatives. There was just one caveat:The original instructions say that
poetry
should be installed withpipx install poetry
However, in my case it detected that there were already some
poetry
files, so I had to do a force installation withpipx install --force poetry
This installed
poetry
v2.1.4 with no issues, making…