Poetry: getting [EnvCommandError] after upgrading Poetry for all commands

Created on 15 Jan 2020  Â·  7Comments  Â·  Source: python-poetry/poetry

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

I recently upgraded poetry poetry from 1.0.0 to 1.0.2 and now i am unable to execute any poetry commands like poetry env list or poetry shell or poetry add for my existing projects. I get the same error every time. I checked my path and i don't seem to have an invalid path so I don't know where the issue is coming from. I uninstalled and reinstalled poetry and still get the same error.

[EnvCommandError]
Command ['C:\\Users\\srikanth\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\pyfmi-test-ckR5wBVt-py3.8\\Scripts\\python.exe', '-'] errored with the following return code 1, and output:
The system cannot find the path specified.
C:\Python38
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\srikanth\.poetry\lib\poetry\_vendor\py3.8\clikit\console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "C:\Users\srikanth\.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\srikanth\.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\srikanth\.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\srikanth\.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\srikanth\.poetry\lib\poetry\console\config\application_config.py", line 88, in set_env
    env = env_manager.create_venv(io)
  File "C:\Users\srikanth\.poetry\lib\poetry\utils\env.py", line 475, in create_venv
    env = self.get(reload=True)
  File "C:\Users\srikanth\.poetry\lib\poetry\utils\env.py", line 347, in get
    return VirtualEnv(venv)
  File "C:\Users\srikanth\.poetry\lib\poetry\utils\env.py", line 1004, in __init__
    self._base = Path(self.run("python", "-", input_=GET_BASE_PREFIX).strip())
  File "C:\Users\srikanth\.poetry\lib\poetry\utils\env.py", line 838, in run
    return self._run(cmd, **kwargs)
  File "C:\Users\srikanth\.poetry\lib\poetry\utils\env.py", line 1071, in _run
    return super(VirtualEnv, self)._run(cmd, **kwargs)
  File "C:\Users\srikanth\.poetry\lib\poetry\utils\env.py", line 875, in _run
    raise EnvCommandError(e, input=input_)
Bug

Most helpful comment

Note that in Windows 10:

> where.exe python
C:\Users\Razor\AppData\Local\Microsoft\WindowsApps\python.exe

But this is NOT python. It is a program that opens the windows store to install python. If this is found in your PATH and poetry tries to use it AND you have NOT installed python from the windows store, you can get this error.

All 7 comments

Solved it. Its a problem when you install and uninstall conda. it creates autorun bindings for cmd.exe in the registry leading to these errors.

Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

Solved it. Its a problem when you install and uninstall conda. it creates autorun bindings for cmd.exe in the registry leading to these errors.

Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

I'm having this same issue. How did you fix it?

Check your PATH variable and those registry keys I mentioned. Make sure all
paths are valid.

On Sun, Feb 23, 2020, 6:38 AM jimbroze notifications@github.com wrote:

I'm having this same issue. How did you fix it?

—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/python-poetry/poetry/issues/1895?email_source=notifications&email_token=AHX37RCGD25GNPJ273VBWJ3REJN2TA5CNFSM4KHKYVKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMVZRBA#issuecomment-590059652,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHX37RCH3WQZPBCE7BNSKWLREJN2TANCNFSM4KHKYVKA
.

Check your PATH variable and those registry keys I mentioned. Make sure all paths are valid.
…
On Sun, Feb 23, 2020, 6:38 AM jimbroze @.*> wrote: I'm having this same issue. How did you fix it? — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <#1895?email_source=notifications&email_token=AHX37RCGD25GNPJ273VBWJ3REJN2TA5CNFSM4KHKYVKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMVZRBA#issuecomment-590059652>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHX37RCH3WQZPBCE7BNSKWLREJN2TANCNFSM4KHKYVKA .

Thanks. Embarrassingly, my non-Anaconda python interpreter wasn't added to the PATH variable.

Note that in Windows 10:

> where.exe python
C:\Users\Razor\AppData\Local\Microsoft\WindowsApps\python.exe

But this is NOT python. It is a program that opens the windows store to install python. If this is found in your PATH and poetry tries to use it AND you have NOT installed python from the windows store, you can get this error.

Note that in Windows 10:

> where.exe python
C:\Users\Razor\AppData\Local\Microsoft\WindowsApps\python.exe

But this is NOT python. It is a program that opens the windows store to install python. If this is found in your PATH and poetry tries to use it AND you have NOT installed python from the windows store, you can get this error.

Nowhere in the original post does the poster mention anything inside the <home>\AppData\Local\Microsoft\WindowsApps\python.exe folder.

Originally when searching for a solution for an error with very similar error message on Windows this and another issue came up as top hits. I was simply adding something I hopped might help others or be related to solving the problem.

Note that when the issue is the one related to the WindowsApps folder I posted, it never comes up in the error either, so I would not expect an issue report to reference this path even when it is the underlying problem. It took some digging to discover they were connected.

Was this page helpful?
0 / 5 - 0 ratings