I installed python3, when I enter python3 in the terminal (on RHEL) I get an error saying 'command not found'. Entering python gets me the 2.x version that came on the computer. Any advice on how I can access python3 from the terminal?
Asked
Active
Viewed 3,409 times
0
-
it seems you need to add python3 to your path variable. Please refer to this discussion: https://www.linuxquestions.org/questions/linux-general-1/how-does-the-default-path-get-set-on-rhel-584001/ – Andre Motta Jul 13 '18 at 14:33
-
2Possible duplicate of [Installing Python 3 on RHEL](https://stackoverflow.com/questions/8087184/installing-python-3-on-rhel) – Druta Ruslan Jul 13 '18 at 14:46
1 Answers
2
Where did you install Python 3 from? Out of the box on RHEL 6 and 7 there are no Python 3 packages. There are supported packages from Red Hat that are part of Red Hat Software collections. To use them you have to enable the RHSCL repo, then install rh-python36. These packages are installed in /opt/rh
, not /usr/bin
, so you need to use scl enable rh-python36 bash
to get a shell with the correct path.
See How to install Python 3 on RHEL on the Red Hat Developer Blog.
It covers:
- Installing Python 3, venv, virtualenv, pipenv
- Tips for working with Red Hat Software Collections
- How to use Python virtual environments so you can safely do pip installs that are isolated and reproducible

Rob T.
- 386
- 3
- 5