Is it possible to use Python 3 instead of Python 2?


I’m really happy how easy it is to put together a simple Python web-application using gomix. I’v noticed however that it still uses Python 2.7. Is it possible to switch to Python 3 somehow?


Yes, you should be able to use python3 as the command instead of python :slight_smile:


Thanks. Unfortunately python3 does not know about the my requirements.txt.


I got Python 3 working with requirements.txt support:


how did you manage that?


If you follow the link above, you can click “View Code” to see how, and after that you can remix the project as a starting point for your own.


thanks! (& apologies) duh … :slight_smile:


would it be easier to point pip3 (instead of pip) to the requirements.txt file?


It might be worth a try. You’d work without a virtualenv and might shave off a few lines of code.


not that i’d now how to do that, just seemed to make sense. if i remix your project everything works but if i copy your to my project i get a permissions error when creating the virtualenv:

2:32 PM
Traceback (most recent call last):
2:32 PM
  File "/usr/local/lib/python2.7/dist-packages/pip/", line 215, in main
2:32 PM
    status =, args)
2:32 PM
  File "/usr/local/lib/python2.7/dist-packages/pip/commands/", line 342, in run
2:32 PM
2:32 PM
  File "/usr/local/lib/python2.7/dist-packages/pip/req/", line 784, in install
2:32 PM
2:32 PM
  File "/usr/local/lib/python2.7/dist-packages/pip/req/", line 851, in install
2:32 PM
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
2:32 PM
  File "/usr/local/lib/python2.7/dist-packages/pip/req/", line 1064, in move_wheel_files
2:32 PM
2:32 PM
  File "/usr/local/lib/python2.7/dist-packages/pip/", line 345, in move_wheel_files
2:32 PM
    clobber(source, lib_dir, True)
2:32 PM
  File "/usr/local/lib/python2.7/dist-packages/pip/", line 323, in clobber
2:32 PM
    shutil.copyfile(srcfile, destfile)
2:32 PM
  File "/usr/lib/python2.7/", line 83, in copyfile
2:32 PM
    with open(dst, 'wb') as fdst:
2:32 PM
Jump to
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/virtualenv.pyc'


I can have a look if you can link your project.



this is it as is (py2.7)

i swapped my for yours and i got that exception


Not sure what’s going on since I’m not too familiar with glitch, but I was able to bootstrap pip in a remix of your project with the following shell-script:


# Exit early on errors
set -eu

# Python buffers stdout. Without this, you won't see what you "print" in the Activity Logs

# Install Python 3 virtual env

if [ ! -d $VIRTUALENV ]; then
  python3 -m venv $VIRTUALENV

if [ ! -f $VIRTUALENV/bin/pip ]; then
  curl --silent --show-error --retry 5 | $VIRTUALENV/bin/python

# Install the requirements
$VIRTUALENV/bin/pip install -r requirements.txt

# Run a glorious Python 3 server