Wednesday, July 9, 2014

Simplifying python2 vs python3 problems

In Arch Linux, python3 is default, so python2 programs have to be started manually, e.g. "python2 prog.py"

But sometimes that isn't enough either, so I found "virtualenv" which allows you to configure individual folders to work with an arbitrary python version.

First you configure the folder:

virtualenv -p python2 ~/myfolder/


Then before you run anything in that folder, you must source the generated script:

$ cd ~/myfolder/
$ source bin/activate
$ ./some_python_app

No comments:

Post a Comment