python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.68k stars 2.27k forks source link

poetry on win10 returns poetry.utils._compat.CalledProcessError #3571

Closed egor187 closed 3 years ago

egor187 commented 3 years ago

Issue

Everytime when i try to create env in NEW project or when try it in exist project poetry.utils.compat.CalledProcessError: Command 'C:\Users\home\AppData\Local\pypoetry\Cache\virtualenvs\study-JYh534Fc-py3.9\Scripts\python.exe -' returned non-zero exit status 1.

Working on win 10 and ubuntu with WSL. Try to run poetry from PyCharm community in cloned project from Github. Poetry plugin installed on PyCharm.

It looks like a problem creating a virtual environment at the specified location. However, I cannot fully understand what the problem is. Has anyone come across a similar one?

In addition, when running poetry run python through Powershell in the finished project, it gives the following error:

Command C:\Users\home_\AppData\Local\pypoetry\Cache\virtualenvs\study-JYh534Fc-py3.9\Scripts\python.exe - errored with the following return code 1, and output: ¨á⥬¥ ­¥ 㤠¥âáï ­ ©â¨ 㪠§ ­­ë© ¯ãâì. 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)

at ~.poetry\lib\poetry\utils\env.py:1074 in _run 1070│ output = subprocess.checkoutput( 1071│ cmd, stderr=subprocess.STDOUT, **kwargs 1072│ ) 1073│ except CalledProcessError as e: → 1074│ raise EnvCommandError(e, input=input) 1075│ 1076│ return decode(output) 1077│ 1078│ def execute(self, bin, *args, **kwargs):

Please tell me how to solve this problem

youguanxinqing commented 3 years ago

Pls write steps for reproduce it or more details. Poetry works on my win10 machine.

egor187 commented 3 years ago

I don't know what exactly happened, but everything started working correctly when I configured "poetry virtualenvs.in-project: True". After that, PyCharm was able to correctly configure the poetry environment, and no longer gave the specified error

TextileTopher commented 2 years ago

I'm having this issue as well...

github-actions[bot] commented 8 months ago

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.