CentOS7 安装 IPython

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

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

1.安装Python

1.1 下载Python-2.7.12

[[email protected] ~]# wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz

1.2 解压Python文件

[[email protected] ~]# tar xf Python-2.7.12.tar.xz 

1.3 进入Python目录

[[email protected] ~]# cd Python-2.7.12/
[[email protected] Python-2.7.12]# 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包

[[email protected] Python-2.7.12]# yum install readline-devel

1.5 使用configure创建makefile

[[email protected] Python-2.7.12]# ./configure --prefix=/usr/local/python27

1.6 安装Python

[[email protected] Python-2.7.12]# make && make install

1.7 查看安装情况

[[email protected] Python-2.7.12]# /usr/local/python27/bin/py
pydoc             python2           python2.7-config  python-config
python            python2.7         python2-config
[[email protected] Python-2.7.12]# /usr/local/python27/bin/python2.7
Python 2.7.12 (default, Jul 22 2016, 07:24:36)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

2.安装Ipython

2.1 下载IPython

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

2.2 解压IPython

[[email protected] ~]# tar xf ipython-5.0.0.tar.gz 

2.3 进入IPython目录

[[email protected] ~]# cd ipython-5.0.0/
[[email protected] ipython-5.0.0]# ls
COPYING.rst  examples  PKG-INFO    scripts       setup.cfg    setupext
docs         IPython   README.rst  setupbase.py  setupegg.py  setup.py

2.4 编译IPython

[[email protected] ipython-5.0.0]# /usr/local/python27/bin/python2.7 setup.py build

2.5 安装IPython

[[email protected] ipython-5.0.0]# /usr/local/python27/bin/python2.7 setup.py install

3.创建符号链接

[[email protected] ipython-5.0.0]# ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python2712
‘/usr/bin/python2712’ -> ‘/usr/local/python27/bin/python2.7’
[[email protected] ipython-5.0.0]# ln -sv /usr/local/python27/bin/ipython /usr/bin/ipython
‘/usr/bin/ipython’ -> ‘/usr/local/python27/bin/ipython’

4.检查和修复Ipython

4.1 检查Ipython的安装

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

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

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

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

4.3 再次检查

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

4.4 安装 ipython-genutils

  方法同上

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

4.5 再次检查

[[email protected] ipython_genutils-0.1.0]# ipython
Traceback (most recent call last):
  File "/usr/bin/ipython", line 4, in <module>
    from IPython import start_ipython
  File "/usr/local/python27/lib/python2.7/site-packages/IPython/__init__.py", line 48, in <module>
    from .core.application import Application
  File "/usr/local/python27/lib/python2.7/site-packages/IPython/core/application.py", line 23, 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 6, in <module>
    from .application import *
  File "/usr/local/python27/lib/python2.7/site-packages/traitlets/config/application.py", line 16, in <module>
    from decorator import decorator
ImportError: No module named decorator

4.6 安装decorator

方法同上

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

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

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

步骤1:yum install python-setuptools

步骤2:安装python,见上面

步骤3:sudo easy_install ipython 使用这个命令就可以安装ipython了。 我真想哭了都。

步骤4:测试ipython

[[email protected] pickleshare-0.7.3]# ipython
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
Type "copyright", "credits" or "license" for more information.

IPython 5.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython‘s features.
%quickref -> Quick reference.
help      -> Python‘s own help system.
object?   -> Details about ‘object‘, use ‘object??‘ for extra details.

In [1]: 

终于可以用了。

时间: 2024-10-06 03:59:08

CentOS7 安装 IPython的相关文章

CentOS7安装ipython

CentOS7安装IPython 介绍 IPython 是一个 python 的交互式 shell,比默认的python shell 好用得多,支持变 量自动补全,自动缩进,支持 bash shell 命令,内置了许多很有用的功能和函数. IPython 是基于BSD 开源的. IPython 为交互式计算提供了一个丰富的架构,包含: 1.强大的交互式 shell 2.Jupyter 内核 3.交互式的数据可视化工具 4.灵活.可嵌入的解释器 5.易于使用,高性能的并行计算工具 安装IPytho

Centos7 安装ipython 和 ipython3

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

Centos7 安装Python3.6.5 及 安装ipython 6.1.0

一.centos7 安装 Python3.6.5教程 1.在安装Python之前,需要先安装一些后面遇到的依赖问题(如果有依赖问题,按照提示安装): yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel     yum install xz gcc zlib 

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] ~

CentOS7.4安装ipython

摘自:https://www.jianshu.com/p/aa93a0341c82 使用pip3安装ipython及其依赖包:pip3 install ipython在 .bashrc文件中添加环境变量设置:alias ipython='python3 -m IPython'使刚修改的.bashrc文件立即生效:source .bashrc 0人点赞 随笔 原文地址:https://www.cnblogs.com/LiuYanYGZ/p/12041790.html

Python -- 关于pip安装Ipython

小Q:山外青山楼外楼,西湖歌舞几时休:暖风熏得游人醉,只把杭州比汴州.     --林升··题临安邸 ======================================================== 来到杭州的第18天,第一次孤身来到南方,每当周六日时孤独感袭来.无奈,只能寻求兴趣.学习,填补. 一直在实验用pip安装ipython的方式,遇到了一些问题,见下: 环境:centos 6 推荐源:wget   http://mirrors.aliyun.com/epel/epel-

Centos 7.4 安装ipython和mysql-python遇到的问题

pip安装ipython报错记录#pip install ipython==5.5.0 Collecting ipython==5.5.0   Downloading http://mirrors.aliyun.com/pypi/packages/08/2c/6285504003b4eadce5540f3ee3adc081468b26723f3eef07d9d5d7d97ed8/ipython-5.5.0-py2-none-any.whl (758kB)     100% |██████████

通过pip3安装ipython

操作系统:Centos7.4:ipython可以用来测试python语句,故需要安装. 首先需要安装epelde的扩展库: easy_install是由PEAK(Python Enterprise Application Kit)开发的setuptools包里带的一个命令,所以使用easy_install实际上是在调用setuptools来完成安装模块的工作(注:来自于百度百科).由于Centos7.4已经安装python2.7的版本,故easy_install已经安装在操作系统上. 此时可通过

centos7 安装pip+python3.6以及pip安装错误解决办法

Centos7安装pip 1.执行:yum install python-pip 若没有python-pip包,先执行:yum -y install epel-release,再执行yum install python-pip 2.pip install --upgrade pip centos默认安装了python2.7 1.mkdir /usr/local/python3 3.安装依赖包: yum -y groupinstall "Development tools" 安装的时候可