Added lines 123 to 127 #1010
Added lines 123 to 127 #1010
Conversation
I was installing Python today with this tutorial and after instaling Python, python --version still pointed to Python 2. I added an alias to my .bash_profile file to point it to Python 3.
|
@dbader Hey Dane, can you check this PR opened a long time ago? |
|
Hey, Mario. Thanks for submitting your PR! And sorry for taking so long to respond. Aliasing isn't perfect because it conflicts with virtual environments. If you define an alias, it'll silently take precedence over an active environment: $ python -m venv env
$ . env/bin/activate
(env) $ which python
/home/jdoe/project/env/bin/python
(env) $ python --version
Python 3.8.0
(env) $ alias python=/usr/bin/python2.7
(env) $ python --version
Python 2.7.17
(env) $ which python
/home/jdoe/project/env/bin/python # <- Python 3.8
(env) $ $(which python) --version
Python 3.8.0If that's not confusing enough, other commands would also require aliasing. Setting an alias just for the (env) $ alias python=/usr/bin/python2.7
(env) $ python --version
Python 2.7.17
(env) $ pip --version
pip 19.2.3 from /home/jdoe/project/env/lib/python3.8/site-packages/pip (python 3.8)A safer bet would be to stick to the virtual environments or use pyenv to manage the installed Python versions. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

I was installing Python today with this tutorial and after instaling Python, python --version still pointed to Python 2. I added an alias to my .bash_profile file to point it to Python 3.