Rita
Rita

Reputation: 1

python3.5 --version command not found CentOS 7

After installation of python 3.5.2 on CentOS 7 command "python3.5 -V" cannot find this command. There is python2.7 installed by default and if we type "python -V" we can see the version 2.7.5. How can I install python 3.5.2 on CentOS to make "python3.5 -V"(and other commands with python3.5) work.

Upvotes: 0

Views: 3167

Answers (1)

Julien
Julien

Reputation: 5729

See all the versions of Python you have available:

$ compgen -c | grep "^python"

The output will be something like

python3
python3-32
python3-config
python3.5
python3.5-32
python3.5-config
python3.5m
python3.5m-config
python3
python3-32
python3-config
python3.5
python3.5-32
python3.5-config
python3.5m
python3.5m-config
python
python-config
python2.6
python2.6-config
python2.7
python2.7-config
pythonw
pythonw2.6
pythonw2.7

Make sure the version you're looking for is in that list. Then, take that and run (if python3.5 is in the list):

$ python3.5 -V

Which should output something like

Python 3.5.2

Upvotes: 1

Related Questions