Centos7下python3安装ipython

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos7下python3安装ipython相关的知识,希望对你有一定的参考价值。

一、通过压缩包安装ipython

1、下载ipython安装包

[[email protected] ~]# wget https://pypi.python.org/packages/79/63/b671fc2bf0051739e87a7478a207bbeb45cfae3c328d38ccdd063d9e0074/ipython-6.1.0.tar.gz#md5=1e15e1ce3f3f722da6935d7ac0e51346

2、安装ipython

[[email protected] ~]# tar xf ipython-6.1.0.tar.gz
[[email protected] ~]# cd ipython-6.1.0
[[email protected] ipython-6.1.0]# pwd
/root/ipython-6.1.0
[[email protected] ipython-6.1.0]# python3 setup.py install
#前提已安装python3,
#linux系统安装python3: http://www.cnblogs.com/chengd/p/7078498.html

3、通过pip安装ipython所有缺失模块,直至ipython运行成功

[[email protected] ~]# 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安装缺失模块
[[email protected] ~]# pip install traitlets
Collecting traitlets
  Downloading traitlets-4.3.2-py2.py3-none-any.whl (74kB)
    100% |?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..?..| 81kB 87kB/s 
Collecting six (from traitlets)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting ipython-genutils (from traitlets)
  Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting decorator (from traitlets)
  Downloading decorator-4.0.11-py2.py3-none-any.whl
Installing collected packages: six, ipython-genutils, decorator, traitlets
Successfully installed decorator-4.0.11 ipython-genutils-0.2.0 six-1.10.0 traitlets-4.3.2
......

二、直接通过pip安装ipython

pip安装地址:http://www.cnblogs.com/chengd/p/7078588.html

[[email protected] pip-9.0.1]# pip install ipython
[[email protected] pip-9.0.1]# ipython
ipython   ipython3  
[[email protected] pip-9.0.1]# ipython3
/usr/local/lib/python3.6/site-packages/IPython/core/history.py:226: UserWarning: IPython History requires SQLite, your history will not be saved
  warn("IPython History requires SQLite, your history will not be saved")
Python 3.6.1 (default, Jun 26 2017, 09:16:04) 
Type copyright, credits or license for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type ? for help.

In [1]: 
#ipython安装成功

 

 





以上是关于Centos7下python3安装ipython的主要内容,如果未能解决你的问题,请参考以下文章

CentOS7安装ipython

CentOS7.4安装ipython

Centos7 安装ipython 和 ipython3

Mac系统下安装ipython分别支持python2和python3

Windows下基于Python3安装Ipython Notebook(即Jupyter)。python –m pip install XXX

linux下ipython无法保存历史记录