简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM