Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"poetry install" fails on windows with demo project and base pyproject.toml #2468

Closed
3 tasks done
evenprimes opened this issue May 28, 2020 · 8 comments · Fixed by #2651
Closed
3 tasks done

"poetry install" fails on windows with demo project and base pyproject.toml #2468

evenprimes opened this issue May 28, 2020 · 8 comments · Fixed by #2651
Labels
kind/bug Something isn't working as expected

Comments

@evenprimes
Copy link


name: "\U0001F41E Bug Report"
about: Did you find a bug?
title: '"poetry install" fails on windows with demo project and base pyproject.toml'
labels: Bug, Triage
assignees: ''


  • 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 v1909 build 18363.836
  • Poetry version: 1.0.5 (installed via PowerShell script)
  • Python version: 3.7.7 (installed via Windows store)
  • Link of a Gist with the contents of your pyproject.toml file: n/a - problem occurs with default pyproject.toml

Issue

After installing and creating a bare demo project, poetry install fails. It looks like
it can't find the sys module.

What I tried

  • Uninstalled Python and installed fresh copy with poetry first/only Python module installed
  • Tried pip install poetry, same error
  • Also tried to install Python 3.8 (also from Windows store), same issue

Other notes

I looked at Virtualenv not always found in case insensitive filesystem, issue #2419, but the paths involved (see below) don't have spaces.

Both the Python 3.7 scripts folder and $home.poetry\bin are in the system path.

This does not seem to be related to the windows rmtree failures previously reported.

Stack trace of failure:

PS C:\Users\didge\Source\poetry-demo> poetry install -vvv
[EnvCommandError]
Command ['C:\\Users\\didge\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\poetry-demo-2Mh1ooRm-py3.7\\Scripts\\python.exe', '-'] errored with the following return code 1, and output:
The system cannot find the path specified.
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\didge\.poetry\lib\poetry\_vendor\py3.7\clikit\console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "C:\Users\didge\.poetry\lib\poetry\_vendor\py3.7\clikit\api\command\command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "C:\Users\didge\.poetry\lib\poetry\_vendor\py3.7\clikit\api\command\command.py", line 163, in _do_handle
    self._dispatcher.dispatch(PRE_HANDLE, event)
  File "C:\Users\didge\.poetry\lib\poetry\_vendor\py3.7\clikit\api\event\event_dispatcher.py", line 22, in dispatch
    self._do_dispatch(listeners, event_name, event)
  File "C:\Users\didge\.poetry\lib\poetry\_vendor\py3.7\clikit\api\event\event_dispatcher.py", line 89, in _do_dispatch
    listener(event, event_name, self)
  File "C:\Users\didge\.poetry\lib\poetry\console\config\application_config.py", line 89, in set_env
    env = env_manager.create_venv(io)
  File "C:\Users\didge\.poetry\lib\poetry\utils\env.py", line 489, in create_venv
    env = self.get(reload=True)
  File "C:\Users\didge\.poetry\lib\poetry\utils\env.py", line 352, in get
    return VirtualEnv(venv)
  File "C:\Users\didge\.poetry\lib\poetry\utils\env.py", line 1022, in __init__
    self._base = Path(self.run('python', '-', input_=GET_BASE_PREFIX).strip())
  File "C:\Users\didge\.poetry\lib\poetry\utils\env.py", line 856, in run
    return self._run(cmd, **kwargs)
  File "C:\Users\didge\.poetry\lib\poetry\utils\env.py", line 1089, in _run
    return super(VirtualEnv, self)._run(cmd, **kwargs)
  File "C:\Users\didge\.poetry\lib\poetry\utils\env.py", line 893, in _run
    raise EnvCommandError(e, input=input_)
@evenprimes evenprimes added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels May 28, 2020
@rafaellehmkuhl
Copy link

rafaellehmkuhl commented Aug 10, 2020

Any news on this one? Same problem here.

Edit: it looks like it has something to do with the python installed by Windows 10 (here and here).

@evenprimes
Copy link
Author

I’ve just given up on using poetry for now, at least for projects hosted on windows.

I’m considering trying it on the next project I host on a Pi.

@abn
Copy link
Member

abn commented Aug 11, 2020

@rafaellehmkuhl @evenprimes does this also happen with the latest pre-release?

@rafaellehmkuhl
Copy link

@rafaellehmkuhl @evenprimes does this also happen with the latest pre-release?

Didn't try. I'm using the latest stable. There was some change regarding this?

@fcruzel
Copy link

fcruzel commented Sep 25, 2020

I solved this problem by deleting the entire pypoetry folder.

rm -r "C:\Users\<Username>\AppData\Local\pypoetry"

@abn abn linked a pull request Sep 28, 2020 that will close this issue
@abn
Copy link
Member

abn commented Sep 28, 2020

This issue could be related to #2651. The original error indicates that instead of the script being passed in as input argument, it was interpreted as a separate command.

This should be resolved in 1.1.0b1.

@abn abn removed the status/triage This issue needs to be triaged label Sep 28, 2020
@abn abn closed this as completed Sep 28, 2020
@Satwikram
Copy link

I changed the registry values Autorun in HKEY_CURRENT_USER\Software\Microsoft\Command Processor from
if exists to blank. It worked in my case.

Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants