Install throws CalledProcessError exit code 106 on windows 10
See original GitHub issue-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option). -
OS version and name: Windows 10
-
Poetry version: 1.0.5
-
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/johanvts/69ee6924868396984d2c3489e604b340
Issue
After doing a clean install I run:
poetry init
no problem, toml is created as linked.
poetry install Creating virtualenv hyperpy-M0-5xabO-py3.8 in C:\Users\Johan\AppData\Local\pypoetry\Cache\virtualenvs [CalledProcessError] Command ‘[‘C:\Users\Johan\AppData\Local\pypoetry\Cache\virtualenvs\hyperpy-M0-5xabO-py3.8\Scripts\python.exe’, ‘-Im’, ‘ensurepip’, ‘–upgrade’, ‘–default-pip’]’ returned non-zero exit status 106.
Subsequent attempts at poetry install gives:
PS C:\Users\Johan\hyperpy> poetry install -vvv
[EnvCommandError] Command [‘C:\Users\Johan\AppData\Local\pypoetry\Cache\virtualenvs\hyperpy-M0-5xabO-py3.8\Scripts\python.exe’, ‘-’] errored with the following return code 1, and output: ‘C:\Users\Johan\AppData\Local\pypoetry\Cache\virtualenvs\hyperpy-M0-5xabO-py3.8\Scripts\python.exe’ is not recognized as an internal or external command, operable program or batch file. input was : import sys
if hasattr(sys, “real_prefix”): print(sys.real_prefix) elif hasattr(sys, “base_prefix”): print(sys.base_prefix) else: print(sys.prefix)
Traceback (most recent call last): File “C:\Users\Johan.poetry\lib\poetry_vendor\py3.8\clikit\console_application.py”, line 131, in run status_code = command.handle(parsed_args, io) File “C:\Users\Johan.poetry\lib\poetry_vendor\py3.8\clikit\api\command\command.py”, line 120, in handle status_code = self._do_handle(args, io) File “C:\Users\Johan.poetry\lib\poetry_vendor\py3.8\clikit\api\command\command.py”, line 163, in _do_handle self._dispatcher.dispatch(PRE_HANDLE, event) File “C:\Users\Johan.poetry\lib\poetry_vendor\py3.8\clikit\api\event\event_dispatcher.py”, line 22, in dispatch self._do_dispatch(listeners, event_name, event) File “C:\Users\Johan.poetry\lib\poetry_vendor\py3.8\clikit\api\event\event_dispatcher.py”, line 89, in _do_dispatch listener(event, event_name, self) File “C:\Users\Johan.poetry\lib\poetry\console\config\application_config.py”, line 89, in set_env env = env_manager.create_venv(io) File “C:\Users\Johan.poetry\lib\poetry\utils\env.py”, line 489, in create_venv env = self.get(reload=True) File “C:\Users\Johan.poetry\lib\poetry\utils\env.py”, line 352, in get return VirtualEnv(venv) File “C:\Users\Johan.poetry\lib\poetry\utils\env.py”, line 1022, in init self.base = Path(self.run(“python”, “-”, input=GET_BASE_PREFIX).strip()) File “C:\Users\Johan.poetry\lib\poetry\utils\env.py”, line 856, in run return self._run(cmd, **kwargs) File “C:\Users\Johan.poetry\lib\poetry\utils\env.py”, line 1089, in _run return super(VirtualEnv, self)._run(cmd, **kwargs) File “C:\Users\Johan.poetry\lib\poetry\utils\env.py”, line 893, in run raise EnvCommandError(e, input=input)
I am aware of https://github.com/python-poetry/poetry/issues/1587 However Python 3.8 is installed through the store and works as expected:
PS C:\Users\Johan\hyperpy> where.exe python C:\Users\Johan\AppData\Local\Microsoft\WindowsApps\python.exe PS C:\Users\Johan\hyperpy> python Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32 Type “help”, “copyright”, “credits” or “license” for more information.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:8
I had this issue in both Powershell and
cmd.exe
, and symlinking worked indeed.For those who don’t how to symlink on Windows (i didn’t have a clue), you need to use
cmd
(not Powershell) then do this:There seems to be something of a path mismatch happening here.
Poetry makes the initial copy of the python executable to
%LocalAppData%\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypoetry\...
, but subsequently expects the environment to be located at%LocalAppData%\pypoetry\...
.Symlinking
%LocalAppData%\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypoetry
to%LocalAppData%\pypoetry
seems to work around the issue for me.