这是一个悲伤的安装ipython的过程。 写下来留个教训吧。 也是希望对博友一些帮助吧。

注:

   我也写了一篇window下安装bpython的文章(个人感觉bpython要比ipython强大的多),地址:http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_python_006_bpython.html

真正需要看的只是第一个部分和第五部分。

官方的ipython安装说明: http://ipython.org/install.html

1.安装Python

1.1 下载Python-2.7.12

[root@bogon ~]# wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz
注意:最新版本的可以在这里下载找到:https://www.python.org/ftp/python

1.2 解压Python文件

[root@bogon ~]# tar xf Python-2.7..tar.xz 

1.3 进入Python目录

[root@bogon ~]# cd Python-2.7./
[root@bogon Python-2.7.]# ls
aclocal.m4 configure Doc install-sh Mac Modules PC Python setup.py
config.guess configure.ac Grammar Lib Makefile.pre.in Objects PCbuild README Tools
config.sub Demo Include LICENSE Misc Parser pyconfig.h.in RISCOS

1.4 安装readline-devel包

[root@bogon Python-2.7.]# yum install readline-devel

1.5 使用configure创建makefile

[root@bogon Python-2.7.]# ./configure --prefix=/usr/local/python27

1.6 安装Python

[root@bogon Python-2.7.]# make && make install

1.7 查看安装情况

[root@bogon Python-2.7.]# /usr/local/python27/bin/py
pydoc python2 python2.-config python-config
python python2. python2-config
[root@bogon Python-2.7.]# /usr/local/python27/bin/python2.
Python 2.7. (default, Jul , ::)
[GCC 4.8. (Red Hat 4.8.-)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

2.安装Ipython

2.1 下载IPython

[root@bogon ~]# wget https://pypi.python.org/packages/09/2e/870d1058768f5240062beb0bd2ff789ac689923501b0dd6b480fb83314fc/ipython-5.0.0.tar.gz#md5=9c00df2f7e2e2636aba02671f45eea6b

注意:最新的IPython可以从这里获取:https://pypi.python.org/pypi/ipython

2.2 解压IPython

[root@bogon ~]# tar xf ipython-5.0..tar.gz 

2.3 进入IPython目录

[root@bogon ~]# cd ipython-5.0./
[root@bogon ipython-5.0.]# ls
COPYING.rst examples PKG-INFO scripts setup.cfg setupext
docs IPython README.rst setupbase.py setupegg.py setup.py

2.4 编译IPython

[root@bogon ipython-5.0.]# /usr/local/python27/bin/python2. setup.py build

2.5 安装IPython

[root@bogon ipython-5.0.]# /usr/local/python27/bin/python2. setup.py install

3.创建符号链接

[root@bogon ipython-5.0.]# ln -sv /usr/local/python27/bin/python2. /usr/bin/python2712
‘/usr/bin/python2712’ -> ‘/usr/local/python27/bin/python2.’
[root@bogon ipython-5.0.]# ln -sv /usr/local/python27/bin/ipython /usr/bin/ipython
‘/usr/bin/ipython’ -> ‘/usr/local/python27/bin/ipython’

4.检查和修复Ipython

4.1 检查Ipython的安装

[root@bogon ~]# ipython
Traceback (most recent call last):
File "/usr/bin/ipython", line , in <module>
from IPython import start_ipython
File "/usr/local/python27/lib/python2.7/site-packages/IPython/__init__.py", line , in <module>
from .core.application import Application
File "/usr/local/python27/lib/python2.7/site-packages/IPython/core/application.py", line , in <module>
from traitlets.config.application import Application, catch_config_error
ImportError: No module named traitlets.config.application

4.2 根据提示安装指定的包 traitlets (查看执行ipython 最后一行的提示错误)

注:安装traitlets 方法和安装ipthon的方法类似。 这里直接粘贴代码。

[root@bogon ~]# wget https://pypi.python.org/packages/a4/07/9b7636322c152ab1dacae9d38131067523d6ce5ca926a656586f6f947e77/traitlets-4.2.2.tar.gz#md5=d0725f9818bd9e112a6531da26d433b8
[root@bogon ~]# tar xf traitlets-4.2..tar.gz
[root@bogon ~]# cd traitlets-4.2./
[root@bogon traitlets-4.2.]# ls
CONTRIBUTING.md COPYING.md docs examples PKG-INFO README.md setup.cfg setup.py traitlets
[root@bogon traitlets-4.2.]# python2712 setup.py build
[root@bogon traitlets-4.2.]# python2712 setup.py install

4.3 再次检查

[root@bogon traitlets-4.2.]# ipython
Traceback (most recent call last):
File "/usr/bin/ipython", line , in <module>
from IPython import start_ipython
File "/usr/local/python27/lib/python2.7/site-packages/IPython/__init__.py", line , in <module>
from .core.application import Application
File "/usr/local/python27/lib/python2.7/site-packages/IPython/core/application.py", line , in <module>
from traitlets.config.application import Application, catch_config_error
File "/usr/local/python27/lib/python2.7/site-packages/traitlets/__init__.py", line , in <module>
from .traitlets import *
File "/usr/local/python27/lib/python2.7/site-packages/traitlets/traitlets.py", line , in <module>
from ipython_genutils import py3compat
ImportError: No module named ipython_genutils

4.4 安装 ipython-genutils

  方法同上

[root@bogon ~]# wget https://pypi.python.org/packages/71/b7/a64c71578521606edbbce15151358598f3dfb72a3431763edc2baf19e71f/ipython_genutils-0.1.0.tar.gz#md5=9a8afbe0978adbcbfcb3b35b2d015a56
[root@bogon ~]# tar xf ipython_genutils-0.1..tar.gz
[root@bogon ~]# cd ipython_genutils-0.1./
[root@bogon ipython_genutils-0.1.]# ls
CONTRIBUTING.md ipython_genutils MANIFEST.in README.md setup.py
COPYING.md ipython_genutils.egg-info PKG-INFO setup.cfg
[root@bogon ipython_genutils-0.1.]# python2712 setup.py build
[root@bogon ipython_genutils-0.1.]# python2712 setup.py install

4.5 再次检查

[root@bogon ipython_genutils-0.1.]# ipython
Traceback (most recent call last):
File "/usr/bin/ipython", line , in <module>
from IPython import start_ipython
File "/usr/local/python27/lib/python2.7/site-packages/IPython/__init__.py", line , in <module>
from .core.application import Application
File "/usr/local/python27/lib/python2.7/site-packages/IPython/core/application.py", line , in <module>
from traitlets.config.application import Application, catch_config_error
File "/usr/local/python27/lib/python2.7/site-packages/traitlets/config/__init__.py", line , in <module>
from .application import *
File "/usr/local/python27/lib/python2.7/site-packages/traitlets/config/application.py", line , in <module>
from decorator import decorator
ImportError: No module named decorator

4.6 安装decorator

方法同上

[root@bogon ~]# wget https://pypi.python.org/packages/13/8a/4eed41e338e8dcc13ca41c94b142d4d20c0de684ee5065523fee406ce76f/decorator-4.0.10.tar.gz#md5=434b57fdc3230c500716c5aff8896100
[root@bogon ~]# ls
anaconda-ks.cfg initial-setup-ks.cfg linux-4.7-rc7.tar.xz Python-2.7..tar.xz
decorator-4.0..tar.gz ipython-5.0. Music Templates
Desktop ipython-5.0..tar.gz Pictures traitlets-4.2.
Documents ipython_genutils-0.1. Public traitlets-4.2..tar.gz
Downloads ipython_genutils-0.1..tar.gz Python-2.7. Videos
[root@bogon ~]# tar xf decorator-4.0..tar.gz
[root@bogon ~]# cd decorator-4.0./
[root@bogon decorator-4.0.]# ls
CHANGES.md docs documentation.pdf LICENSE.txt MANIFEST.in performance.sh PKG-INFO setup.cfg setup.py src
[root@bogon decorator-4.0.]# python2712 setup.py build
[root@bogon decorator-4.0.]# python2712 setup.py install

接下来就是一系列的啦。 我弄了1个小时还是缺少, 实在没有那个耐心了(头都要炸了)。 在百度了一下。

5.下面的就是重新查阅了网络资源, 找到了好的办法。

先获取pip,然后通过pip安装。


curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

/usr/local/python27/bin/python get_pip.py 
/usr/local/python27/bin/pip install ipython

终于可以用了。

注意:ipython6貌似不提供python2系列的支持了,python2系列的可以安装低版本的ipython,当然可以升级python2到python3。当然可以尝试下使用bpython,esasy_install bpython即可, 个人感觉bpython比ipython提示更智能。

记一次安装Ipython的流程的更多相关文章

  1. PHP开发环境&amp;MySQL下载安装及配置流程

    PHP开发环境&MySQL下载安装及配置流程 因工作须要,从0開始学PHP,前几天看完视频教程后開始搞开发环境,到今天才好.这里把安装配置流程梳理一下分享出来. 一.概述 要搭建一个开发环境无 ...

  2. 源码安装ipython,并在ipython中整合spark

    一.安装ipython 下载ipython, https://pypi.python.org/packages/source/i/ipython/ipython-2.2.0.tar.gz#md5=b9 ...

  3. CentOS 6.5升级Python和安装IPython

    <转自:http://www.noanylove.com/2014/10/centos-6-5-sheng-ji-python-he-an-zhuang-ipython/>自己常用.以做备 ...

  4. [py]安装ipython

    系统:crunch bang11+python2.7.3 准备工具: sudo apt-get install python-pip python-dev build-essential 安装setu ...

  5. linux安装IPython四种方法

    IPython是Python的交互式Shell,提供了代码自动补完,自动缩进,高亮显示,执行Shell命令等非常有用的特性.特别是它的代码补完功能,例如:在输入zlib.之后按下Tab键,IPytho ...

  6. 安装ipython notebook

    从http://cs231n.github.io/assignments2016/assignment1/开始说起,因为要学习cs231n课程,需要安装ipython notebook,原本电脑中安装 ...

  7. 安装IPython攻略

    由于对python自带的idle不太满意,看到有介绍说ipython不错,于是想装一个试试. 机器上该装的扩展包都已经装好了,比如setuptools,matplotlib,环境变量配置,所以安装起来 ...

  8. linux centos ubentu安装IPython四种方法

    IPython是Python的交互式Shell,提供了代码自动补完,自动缩进,高亮显示,执行Shell命令等非常有用的特性.特别是它的代码补完功能,例如:在输入zlib.之后按下Tab键,IPytho ...

  9. windows安装ipython的困难重重

    本机环境 系统: windows 10 64位 python版本:3.2.1 安装过程 安装ipython可以使用python的pip工具 pip install ipython 在使用pip前,我准 ...

随机推荐

  1. Shiro与Spring整合

    Shiro引入Spring 添加jar包/maven配置 <!-- shiro支持 --> <dependency> <groupId>org.apache.shi ...

  2. 1030 Travel Plan Dijkstra+dfs

    和1018思路如出一辙,先求最短路径,再dfs遍历 #include <iostream> #include <cstdio> #include <vector> ...

  3. 解决 Files 的值"<<<<<<< HEAD"无效。路径中具有非法字符

    通常我们使用版本控制后会出现诸如此类的问题,此时从vs工具找错误和调试是无法找到问题的,也不影响项目的运行,但是有错误就是得解决.原因是版本控制导致文件的路径出现问题. 解决 Files 的值&quo ...

  4. pom.xml文件模板、application文件模板、configuration逆向生成文件、

    pom: <?xml version="1.0" encoding="UTF-8"?><project xmlns="http:// ...

  5. mac os 下 vs code 开发 .net core

    1.软件下载 .net core 2.0 sdk: vs code 最新版: 2.用 dotnet 命令行 dotnet cli 创建项目 打开终端,创建这次项目的文件夹,mkdir Demo1: c ...

  6. ios uibutton加数字角标

    http://www.jianshu.com/p/0c7fae1cadac 第一种:https://github.com/mikeMTOL/UIBarButtonItem-Badge第二种:https ...

  7. 急速安装lnmp 编译版本-wiki-shell脚本实现一键部署

    shell脚本lnmp.sh 环境:centos 6.5 .64位 #!/bin/bash yum install -y nano vim wget wget http://www.atomicorp ...

  8. mysql--user表

    mysql数据库 用例:mysql  mysql> show tables; +---------------------------+ | Tables_in_mysql | +------- ...

  9. XML学习总结二——DTD

    主要用处是约束XML. 1.DTD分为内部DTD与外部DTD两类: 内部DTD:将DTD定义在XML文档的内部 <!DOCTYPE  根元素名  [    元素描述]> 外部DTD < ...

  10. unity shader 常用函数列表

    此篇博客转自csdn的一位大牛. 中间排版出了一些问题 Intrinsic Functions (DirectX HLSL) The following table lists the intrins ...