Skip to content

poetry install fails because a space in path to env #3013

@fcruzel

Description

@fcruzel
  • 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).

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 (#199, #657), but in those instances the error was fixed. This one is happening in the latest version of Poetry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions