Poetry self uninstall failing on Windows
Issue
When I run "poetry self uinstall" on windows I get the following error message:
Traceback (most recent call last):
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\cleo\application.py", line 327, in run
exit_code = self._run(io)
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\console\application.py", line 188, in _run self._load_plugins(io)
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\console\application.py", line 355, in _load_plugins
manager.load_plugins()
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\plugins\plugin_manager.py", line 38, in load_plugins
self._load_plugin_entry_point(ep)
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\plugins\plugin_manager.py", line 76, in _load_plugin_entry_point
plugin = ep.load() # type: ignore[no-untyped-call]
File "C:\Users\tsara\.pyenv\pyenv-win\versions\3.10.5\lib\importlib\metadata\__init__.py", line 171, in load
module = import_module(match.group('module'))
File "C:\Users\tsara\.pyenv\pyenv-win\versions\3.10.5\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry_plugin_export\plugins.py", line 7, in <module>
from poetry_plugin_export.command import ExportCommand
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry_plugin_export\command.py", line 10, in <module>
from poetry_plugin_export.exporter import Exporter
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry_plugin_export\exporter.py", line 11, in <module>
from poetry.repositories.http_repository import HTTPRepository
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\repositories\http_repository.py", line 22, in <module>
from poetry.repositories.cached_repository import CachedRepository
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\repositories\cached_repository.py", line 11, in <module>
from poetry.config.config import Config
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\config\config.py", line 14, in <module>
from poetry.core.toml import TOMLFile
ModuleNotFoundError: No module named 'poetry.core.toml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\tsara\.pyenv\pyenv-win\versions\3.10.5\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\tsara\.pyenv\pyenv-win\versions\3.10.5\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\Scripts\poetry.exe\__main__.py", line 7, in <module>
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\console\application.py", line 406, in main exit_code: int = Application().run()
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\cleo\application.py", line 338, in run
self.render_error(e, io)
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\console\application.py", line 180, in render_error
self.set_solution_provider_repository(self._get_solution_provider_repository())
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\console\application.py", line 395, in _get_solution_provider_repository
from poetry.mixology.solutions.providers.python_requirement_solution_provider import ( # noqa: E501
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\mixology\solutions\providers\__init__.py", line 3, in <module>
from poetry.mixology.solutions.providers.python_requirement_solution_provider import (
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\mixology\solutions\providers\python_requirement_solution_provider.py", line 9, in <module>
from poetry.puzzle.exceptions import SolverProblemError
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\puzzle\__init__.py", line 3, in <module>
from poetry.puzzle.solver import Solver
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\puzzle\solver.py", line 19, in <module>
from poetry.puzzle.provider import Indicator
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\puzzle\provider.py", line 25, in <module>
from poetry.inspection.info import PackageInfo
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\inspection\info.py", line 25, in <module>
from poetry.utils.env import EnvCommandError
File "C:\Users\tsara\AppData\Roaming\pypoetry\venv\lib\site-packages\poetry\utils\env.py", line 37, in <module>
from poetry.core.toml.file import TOMLFile
ModuleNotFoundError: No module named 'poetry.core.toml'
could you include command call?
could you include command call?
poetry self uninstall
poetry self uninstall
Ok, what were you trying to achieve?
poetry self uninstall
Ok, what were you trying to achieve?
to uninstall poetry :/
poetry self uninstall is not a command that exists. what should happen when you run it is that it tells you that.
So this shows that you have somehow gotten your poetry installation into a bad state: but only you know what you did to get there and you haven't said.
(The issue template is there for a reason!)