This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yan12125
Recipients alexreg, ned.deily, ronaldoussoren, vinay.sajip, yan12125
Date 2016-12-16.15:27:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Seems there are quite a few typos/copy-paste errors in the original steps-to-reproduce. Here are my steps on macOS:

$ ./python-build/python.exe -m venv 'aaa bbb'
$ source ./aaa\ bbb/bin/activate
$ pip
zsh: /Users/yen/tmp/aaa bbb/bin/pip: bad interpreter: "/Users/yen/tmp/aaa: no such file or directory

The result is similar on Linux.

Like Alex said, I don't think there's a portable solution, either, so here's a patch to warn users for possibly broken paths.

macOS kernel has another bug/limitation. In XNU, '#' symbol also breaks shebang:

$ ./python-build/python.exe -m venv 'aaa#bbb'
$ source ./aaa\#bbb/bin/activate
$ pip
zsh: /Users/yen/tmp/aaa#bbb/bin/pip: bad interpreter: /Users/yen/tmp/aaa#bbb/bin/python: no such file or directory

This is even confusing as the kernel thinks the interpreter is /Users/yen/tmp/aaa (everything after the first # is thrown away, see [1]) while zsh/bash thinks it's /Users/yen/tmp/aaa#bbb/bin/python. As a result, I add a warning for #, too

Some related discussions:
1. (pip does not support spaces in directories names)
2. (Whitespace in root path of virtualenv breaks scripts)
3. (bad interpreter error when creating virtualenv's in directories with '#' in name)

Adding venv maintainer and some macOS experts

[1], line 511
Date User Action Args
2016-12-16 15:27:43yan12125setrecipients: + yan12125, vinay.sajip, ronaldoussoren, ned.deily, alexreg
2016-12-16 15:27:43yan12125setmessageid: <>
2016-12-16 15:27:43yan12125linkissue28446 messages
2016-12-16 15:27:42yan12125create