yum使用的是python2,替换python3之后可能导致无法正常工作,因此需要yum继续使用python2
# head -1 /usr/bin/yum
#!/usr/bin/python2
# head -1 /usr/libexec/urlgrabber-ext-down
#! /usr/bin/python2
进入python3
# python
Python 3.6.1 (default, Dec 23 2017, 18:29:11)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit() 安装ipython3
安装ipython
# tar xf ipython-6.1.0.tar.gz
# cd ipython-6.1.0
# python setup.py install
......
......
changing mode of /usr/python3.6/bin/ipython3 to 755
changing mode of /usr/python3.6/bin/iptest3 to 755
running install_data
copying docs/man/ipython.1 -> /usr/python3.6/share/man/man1
running install_egg_info
Writing /usr/python3.6/lib/python3.6/site-packages/ipython-6.1.0-py3.6.egg-info
进入ipython,报错
# ipython
Traceback (most recent call last):
File "/usr/python3.6/bin/ipython", line 4, in <module>
from IPython import start_ipython
File "/usr/python3.6/lib/python3.6/site-packages/IPython/__init__.py", line 54, in <module>
from .core.application import Application
File "/usr/python3.6/lib/python3.6/site-packages/IPython/core/application.py", line 23, in <module>
from traitlets.config.application import Application, catch_config_error
ModuleNotFoundError: No module named 'traitlets'
#ipython
Python 3.6.1 (default, Dec 23 2017, 19:28:41)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: