Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm trying to use python3.6 -m venv test directly in PythonAnywhere to create a virtualenv. I wanted to use this method as I believe it is more portable to other environments where virtualenvwrapper might not be set up.

When I run the command (in a PA environment that has been upgraded to use Python 3.6) I get the following error.

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.
like image 913
Dave Potts Avatar asked Apr 07 '17 12:04

Dave Potts


1 Answers

PythonAnywhere dev here: this appears to be a bug in Ubuntu 14.04 (and apparently 15.04), which we were based on when this question was originally asked.

This Ask Ubuntu question has various suggestions; here's one that I've made 100% certain works on PythonAnywhere:

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

[Update 28 June 2018: Switching to a 16.04 image is, coincidentally, what we're working on right now.]

[Update 30 September 2018: the 16.04 image is now live for new PythonAnywhere accounts]

like image 135
Giles Thomas Avatar answered Jan 01 '23 19:01

Giles Thomas