Skip to content

Poetry add fails if path to venv contains space #199

@Oisins

Description

@Oisins

If I run the CLI command poetry add <package-name> whilst in a virtual environment to which the path contains a space I get the following error:

[VenvCommandError]  
Command C:\Users\Oisin Smith\PycharmProjects\WxEpos\venv\Scripts\python.exe -c "import sys; print('.'.join([str(s) for s in sys.version_info[:3]]))" errored with the following output:
'C:\Users\Firstname' is not recognized as an internal or external command operable program or batch file

The problem seems to be that the venv is somewhere inside the C:\Users\Firstname Lastname directory that contains a space. This seems to be the Line causing the error https://github.com/sdispater/poetry/blob/master/poetry/utils/venv.py#L175

One possible fix would be to change this line to add quotes around the bin (ie. bin = f"'{bin}'") string.` I'm not sure where it would be most appropriate to change, so if you let me know, I could create a PR.

Thank you for your great work on this package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/venvRelated to virtualenv managementkind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions