Hacker News new | ask | show | jobs
by ssebastianj 2863 days ago
Not the parent but on Ubuntu I use:

$ python -m pip ... # Use Python 2

$ python2 -m pip ... # If you want to be sure is using Python 2

$ python3 -m pip ... # Use Python 3

$ python3 -m venv ... # Create a virtualenv with Python 3 as documented on https://docs.python.org/3/library/venv.html to "prevent any potential confusion as to which Python interpreter a virtual environment will be based on"

I know it's verbose and long to type but looks explicit to me and saved me to use the wrong version of Python several times.