Virtualenv: Pip fails with space in virtualenv path

Created on 8 Dec 2016  ·  7Comments  ·  Source: pypa/virtualenv

Failed to execute process '/Users/.../venv/bin/pip'. Reason:
The file '/Users/.../venv/bin/pip' does not exist or could not be executed.

python 2.7 installed via homebrew
virtualenv installed via pip

Most helpful comment

+1. I'm also facing this issue.

All 7 comments

Both Apple's XNU kernel [1] and Linux [2] cuts off interpreter name at the first whitespace. In other words, paths with whitespaces (' ' 0x20 and '\t' 0x09) can't work correctly. I suggest virtualenv forbid such paths.

[1] https://github.com/opensource-apple/xnu/blob/10.11/bsd/kern/kern_exec.c#L532-L535
[2] https://github.com/torvalds/linux/blob/v4.9-rc8/fs/binfmt_script.c#L60-L68

Seems this issue is identical to https://github.com/pypa/pip/issues/923

+1. I'm also facing this issue.

This looks to me like a duplicate of #53 "Whitespace in root path of virtualenv breaks scripts".
I want to repeat the comment from https://github.com/pypa/virtualenv/issues/997#issuecomment-270681253, "virtualenv are broken with fragile kernel shebang parsing." And in that spirit, #1014 "Not compatible with a directory having emojis in its path" is another example of virtualenv being broken by fragile kernel shebang parsing. I'll bet the problem occurs with any non-ASCII characters in the path, I'll bet.

Maybe we should collect all three aspects of fragile kernel shebang parsing into one issue, so that we can be sure that one fix can address spaces, length, and non-ASCII characters? I nominate #53, because it's the oldest.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

This issue may be a manifestation of an underlying problem tracked by #53. According to https://github.com/pypa/virtualenv/issues/53#issuecomment-429672379, "It appears this bug is fixed by pip 10.0.0, released 2018-04-14." So, is this issue fixed in pip 10.0.0 as well?

You are right, thanks!

Was this page helpful?
0 / 5 - 0 ratings