poetry install fails because a space in path to env
See original GitHub issue-
I am on the latest Poetry version.
I’m on 1.1.0rc1
-
I have searched the issues of this repo and believe that this is not a duplicate.
There are issues that deal with this error but are one or two years old, are closed or marked as fixed and the error output message is different.
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Windows 10 v2004
- Poetry version: 1.1.0rc1
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/cruzelante098/4a46e9387a50c7ea339adaac5421001f
Issue
poetry install
throws the next error:
EnvCommandError
Command "C:\Users\John Smith\AppData\Local\pypoetry\Cache\virtualenvs\dge-bot-KUpJK1g6-py3.7\Scripts\pip.exe" install --no-deps C:\Users\John Smith\AppData\Local\pypoetry\Cache\artifacts\61\a4\b1\1096e79aeb46c7d99c2c17427ce252e25c6bf439f2b2747770cbcda517\zipp-3.2.0-py3-none-any.whl errored with the following return code 1, and output:
ERROR: Invalid requirement: 'C:\\Users\\John'
Hint: It looks like a path. It does exist.
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the 'C:\Users\John Smith\AppData\Local\pypoetry\Cache\virtualenvs\dge-bot-KUpJK1g6-py3.7\Scripts\python.exe -m pip install --upgrade pip' command.
at c:\users\john smith\appdata\local\programs\python\python37\lib\site-packages\poetry\utils\env.py:944 in _run
940│ output = subprocess.check_output(
941│ cmd, stderr=subprocess.STDOUT, **kwargs
942│ )
943│ except CalledProcessError as e:
→ 944│ raise EnvCommandError(e, input=input_)
945│
946│ return decode(output)
947│
948│ def execute(self, bin, *args, **kwargs):
The error seems to be caused because there’s a space in my username, that’s included in the path to the virtualenv.
This error has been reported before (https://github.com/python-poetry/poetry/issues/199, https://github.com/python-poetry/poetry/issues/657), but in those instances the error was fixed. This one is happening in the latest version of Poetry.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Oh… I had forgotten that I was using 1.1.0rc1. Thank you.
Sure, I’ll open a new issue. Thank you @abn
Looks like poetry is downloading the exe for some reason and pip doesn’t like the exe. Can you raise a separate issue for that please? You can work around it by using a url dependency pointing to the zip file directly.
As for poetry update, if you have an older poetrg performing the update you will have the bug since well it is not updated yet. 😃