ipython安装成功后用不了_iPython的安装及问题解决

IPython是python的一个第三方库,使用PIP工具是很容易安装的,但有时总会出些问题,比如2.7.x版本的不能安装IPython的最新版本,会提示有错误。接下来介绍iPython的安装过程及方法。

直接使用pip为python2.7.x安装会报如下错误

[root@localhost Python]# pip install ipython

Collecting ipython

Downloading https://pypi.tuna.tsinghua.edu.cn/packages/75/03/bb1ce0cf9f8a86f52b34090708e1806bc11e2d29b193e7d6fe0afe9a61e5/ipython-6.0.0.tar.gz (5.1MB)

100% |████████████████████████████████| 5.1MB 231kB/s

Complete output from command python setup.py egg_info:

IPython 6.0+ does not support Python 2.6, 2.7, 3.0, 3.1, or 3.2.

When using Python 2.7, please install IPython 5.x LTS Long Term Support version.

Beginning with IPython 6.0, Python 3.3 and above is required.

See IPython `README.rst` file for more information:

https://github.com/ipython/ipython/blob/master/README.rst

Python sys.version_info(major=2, minor=7, micro=13, releaselevel='final', serial=0) detected.

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-wcZlpN/ipython/

有两种解决方法,第一种是从github下载5.X的源代码编译安装,另一种是指定ipython的版本【推荐】。先介绍第一种方式,源代码编译安装【来自于github官方指导】

wget https://codeload.github.com/ipython/ipython/zip/5.x -o ipython-5.x.zip

unzip ipython-5.x.zip

cd ipython-5.x

# The [test] extra ensures test dependencies are installed too:

pip install .[test]

#Do not invoke setup.py directly as this can have undesirable consequences for further upgrades. We do not recommend using easy_install either.

ln -sf /usr/local/bin/ipython /usr/bin/ipython

ipython -V

或者指定版本【推荐】

sudo pip install ipython==8888 #现指定一个不存在的版本以查看可用版本,发现5版本中有5.3.0(你的可能不一样)

sudo pip install ipython==5.3.0

如果你觉得查询版本号的方法太过于民科,请参考yolk3k 强大的Python管理工具

另外一种warning

/usr/local/lib/python2.7/site-packages/IPython/core/history.py:228: UserWarning: IPython History requires SQLite, your history will not be saved

warn("IPython History requires SQLite, your history will not be saved")

Python 2.7.13 (default, May 8 2017, 04:15:39)

sudo yum install sqlite-devel

sudo pip install pysqlite

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值