发布时间:2019-09-02 07:46:23编辑:auto阅读(1456)
默认centos7的python版本是python2.7,并且没有安装ipython
# yum install xz gcc zlib zlib-devel wget sqlite-devel openssl-devel -y
# wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
# tar xf Python-3.6.1.tar.xz
进入目录安装编译
# cd Python-3.6.1
# ./configure --prefix=/usr/python3.6
# make && make install
# cd /usr/bin/
# mv python python.bak
# ln -s /usr/python3.6/bin/python3 /usr/bin/python
# tail -1 /etc/profile
PATH=$PATH:/usr/python3.6/bin/
# . /etc/profile
# head -1 /usr/bin/yum
#!/usr/bin/python2
# head -1 /usr/libexec/urlgrabber-ext-down
#! /usr/bin/python2
# 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()
# wget https://pypi.python.org/packages/79/63/b671fc2bf0051739e87a7478a207bbeb45cfae3c328d38ccdd063d9e0074/ipython-6.1.0.tar.gz#md5=1e15e1ce3f3f722da6935d7ac0e51346
# 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
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'
根据报错提示安装缺失的相关模块
# pip3 install traitlets
# pip3 install pygments
# pip3 install pexpect
# pip3 install pickleshare
# pip3 install prompt_toolkit
# pip3 install simplegeneric
#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]:
上一篇: python xlsxwriter 写e
下一篇: H3C Cloud Lab 安装
47867
46433
37321
34767
29336
25998
24951
19970
19568
18056
5810°
6436°
5953°
5978°
7083°
5928°
5969°
6461°
6425°
7803°