PythonAnywhere `python3.6 -m venv test` 结果错误

PythonAnywhere `python3.6 -m venv test` Results in Error

我正在尝试在 PythonAnywhere 中直接使用 python3.6 -m venv test 来创建一个 virtualenv。我想使用这种方法,因为我相信它更适合其他可能未设置 virtualenvwrapper 的环境。

当我 运行 命令时(在已升级为使用 Python 3.6 的 PA 环境中)我收到以下错误。

12:34 ~ $ python3.6 -m venv test
Error: Command '['/home/dpottsagilisys/test/bin/python3.6', '-Im', 'ensurepip', 
'--upgrade', '--default-pip']' returned non-zero exit status 1.

这里是 PythonAnywhere 开发人员:这似乎是 Ubuntu 14.04(显然是 15.04)中的一个错误,我们最初提出这个问题时基于它。

This Ask Ubuntu question有各种建议;这是我在 PythonAnywhere 上 100% 确定的作品:

python3.6 -m venv --without-pip test
source test/bin/activate
curl https://bootstrap.pypa.io/get-pip.py | python
deactivate
source test/bin/activate

[2018 年 6 月 28 日更新:巧合的是,切换到 16.04 映像正是我们目前正在做的事情。]

[2018 年 9 月 30 日更新:新 PythonAnywhere 帐户现在可以使用 16.04 映像]

Not having the package python3.6-venv 导致此问题。安装:
sudo apt-get install python3.6-venv 应该解决。