question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Install throws CalledProcessError exit code 106 on windows 10

See original GitHub issue

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:open
  • Created 3 years ago
  • Reactions:6
  • Comments:8

github_iconTop GitHub Comments

5reactions
haycommented, Aug 9, 2020

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:

cd %LocalAppData%
rmdir /q /s pypoetry
mklink /d %LocalAppData%\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\pypoetry pypoetry
5reactions
thesmiley1commented, Jun 26, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Behavior when specified installer returns non-zero exit code
I found that if the error is ignored the package is just fine. This dialog should probably look more like a warning, probably...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
systemPrefs with at least two files" status:RESOLVED resolution:OBSOLETE ... with signal 10 (bus error)" status:RESOLVED resolution:OBSOLETE severity:normal ...
Read more >
subprocess.CalledProcessError: Command pip install pkg ...
Using Python 3.9.6, unable to get the below code executed and its throwing error for --pkg-- package. Error is given at below. However,...
Read more >
buildozer - PyPI
Buildozer. Tests Android iOS Coverage Status Backers on Open Collective Sponsors on Open Collective. Buildozer is a tool for creating application packages ...
Read more >
Python and exit codes - YouTube
What is an " exit code," and why do you sometimes see that a Python program had " exit code 0"? In this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found