Added lines 123 to 127 #1010
Closed
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
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.