# 安装报错之缺失依赖库 [root@localhost Python-3.6.1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for python3.6... no checking for python3... no checking for python... python checking for --enable-universalsdk... no checking for --with-universal-archs... no checking MACHDEP... linux checking for --without-gcc... no checking for --with-icc... no checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/root/Python-3.6.1`: configure: error: no acceptable C compiler found in$PATH See `config.log` for more details
# 重新安装 [root@localhost Python-3.6.1]# make && make install
# python3.6已安装成功(在/usr/local/bin下生成命令python3) [root@localhost local]# ll /usr/local/bin/ total 24656 lrwxrwxrwx. 1 root root 8 Jun 25 11:22 2to3 -> 2to3-3.6 -rwxr-xr-x. 1 root root 101 Jun 25 11:22 2to3-3.6 -rwxr-xr-x. 1 root root 242 Jun 25 11:22 easy_install-3.6 lrwxrwxrwx. 1 root root 7 Jun 25 11:22 idle3 -> idle3.6 -rwxr-xr-x. 1 root root 99 Jun 25 11:22 idle3.6 -rwxr-xr-x. 1 root root 214 Jun 25 11:22 pip3 -rwxr-xr-x. 1 root root 214 Jun 25 11:22 pip3.6 lrwxrwxrwx. 1 root root 8 Jun 25 11:22 pydoc3 -> pydoc3.6 -rwxr-xr-x. 1 root root 84 Jun 25 11:22 pydoc3.6 lrwxrwxrwx. 1 root root 9 Jun 25 11:22 python3 -> python3.6 -rwxr-xr-x. 2 root root 12604536 Jun 25 11:21 python3.6 lrwxrwxrwx. 1 root root 17 Jun 25 11:22 python3.6-config -> python3.6m-config -rwxr-xr-x. 2 root root 12604536 Jun 25 11:21 python3.6m -rwxr-xr-x. 1 root root 3097 Jun 25 11:22 python3.6m-config lrwxrwxrwx. 1 root root 16 Jun 25 11:22 python3-config -> python3.6-config lrwxrwxrwx. 1 root root 10 Jun 25 11:22 pyvenv -> pyvenv-3.6 -rwxr-xr-x. 1 root root 441 Jun 25 11:22 pyvenv-3.6
# 查看版本 [root@localhost local]# python3 -V Python 3.6.1 [root@localhost local]# python3 Python 3.6.1 (default, Jun 25 2017, 11:20:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux Type "help", "copyright", "credits" or "license"for more information.
# 安装ipython $ tar xf ipython-6.1.0.tar.gz $ cd ipython-6.1.0 $ pwd /root/ipython-6.1.0 $ python3 setup.py install
# 通过pip安装ipython所有缺失模块,直至ipython运行成功 $ ipython Traceback (most recent call last): File "/usr/local/bin/ipython", line 4, in <module> from IPython import start_ipython File "/usr/local/lib/python3.6/site-packages/IPython/__init__.py", line 54, in <module> from .core.application import Application File "/usr/local/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是提示缺少'traitlets'模块; # 安装提示一步步通过pip安装缺失模块 $ pip3 install 'traitlets' $ pip3 install 'pygments' $ pip3 install 'pexpect' $ pip3 install 'pickleshare' $ pip3 install 'prompt_toolkit' $ pip3 install prompt-toolkit==1.0.15 $ pip3 install 'simplegeneric'
# 重新运行ipython $ ipython Python 3.6.1 (default, Jan 19 2019, 16:28:00) Type 'copyright', 'credits' or 'license'for more information IPython 6.1.0 -- An enhanced Interactive Python. Type '?'forhelp. In [1]: