IPython

IPython 本身的官方资源库。IPython 组织中的其他资源库包含网站、文档构建等内容。「Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.」

Github stars Tracking Chart

IPython:高效互动计算

概述

欢迎来到 IPython。我们的完整文档可在 ipython.readthedocs.io 上找到,包含了如何安装、使用和为项目做贡献的信息。IPython(Interactive Python) 是一个用多种编程语言进行交互式计算的命令壳,最初是为 Python 编程语言开发的,它提供了自省、富媒体、shell 语法、标签完成和历史记录等功能。

IPython 版本和 Python 支持

从 IPython 7.10 开始,IPython 遵循 NEP 29 的规定。

IPython 7.17+需要Python 3.7及以上版本。

IPython 7.10+需要Python 3.6及以上版本。

IPython 7.0需要Python 3.5及以上版本。

IPython 6.x需要Python 3.3及以上版本。

IPython 5.x LTS 是 Python 2.7 的兼容版本。如果您需要Python 2的支持,您必须使用IPython 5.x LTS。请根据需要更新您的项目配置和需求。

Notebook、Qt 控制台和其他一些部件现在是 Jupyter 的一部分。请看 Jupyter 的安装文档

IPython 的主要特点

  • 全面的对象内省。
  • 输入历史,跨会话的持久性。
  • 在会话中通过自动生成的引用缓存输出结果。
  • 可扩展的标签完成,默认支持完成 python 变量和关键字、文件名和函数关键字。
  • 可扩展的 "魔法" 命令系统,用于控制环境和执行许多与 IPython 或操作系统相关的任务。
  • 丰富的配置系统,可在不同的设置之间轻松切换(比每次改变 $PYTHONSTARTUP 环境变量更简单)。
  • 会话记录和重载。
  • 可扩展的语法处理,以满足特殊情况的需要。
  • 通过用户可扩展的别名系统访问系统 shell。
  • 易于嵌入到其他 Python 程序和 GUI 中。

开发和即时运行

你可以在readthedocs上找到最新版本的开发文档。

你可以在这个目录下运行IPython,甚至不需要在整个系统中安装它,在终端机上键入。

$ python -m IPython

或者在 read the docs 上查看开发安装文档,了解最新的版本。

旧版 IPython 的文档和安装说明可以在 IPython 网站上找到。

IPython 需要 Python 版本 3 或以上

从 6.0 版本开始,IPython 不支持 Python 2.7、3.0、3.1 或 3.2。

对于兼容 Python 2.7 的版本,请安装 5.x LTS 长期支持版本。

如果您遇到这个错误信息,您很可能是在尝试从源码安装或使用 IPython,您需要检查远程 5.x LTS 长期支持版本。你需要检查远程 5.x 分支。如果你使用的是 git,下面的操作应该可以。

$ git fetch origin
$ git checkout 5.x

如果你在正常安装 IPython 时遇到这个错误信息,那么你可能需要更新你的包管理器,例如,如果你使用 pip 检查 pip 的版本。

$ pip --version

你需要更新 pip 到 9.0.1 以上的版本。如果你没有使用 pip,请向你的包管理器的维护者咨询。

更多信息请参考我们的一篇博客文章。
https://blog.jupyter.org/release-of-ipython-5-0-8c...

以及下面的 Pull-Request 讨论:
https://github.com/ipython/ipython/pull/9900

如果你直接调用 setup.py,或者使用 easy_install,也会出现这个错误。如果是这种情况,请使用 pip install. 代替 setup.py install,使用 pip install -e. 代替 setup.py develop。

install_req = ['ipython']
if sys.version_info[0] < 3 and 'bdist_wheel' not in sys.argv:
    install_req.remove('ipython')
    install_req.append('ipython<6')
setup(
    ...
    install_requires=install_req
)

IPython 的替代产品

IPython 可能不符合你的口味;如果是这样的话,你可能会想使用类似的项目。

使用 git blame.ignoreRevsFile 忽略提交。

从 git 2.23 开始,可以在不破坏 git blame 的情况下进行格式化修改。更多细节请参见 git 文档。

要使用这个功能,你必须

  • Install git >= 2.23
  • Configure your local git repo by running:
    • POSIX: tools\configure-git-blame-ignore-revs.sh
    • Windows: tools\configure-git-blame-ignore-revs.bat


Overview

Name With Ownerfacebookresearch/Detectron
Primary LanguagePython
Program languagePython (Language Count: 8)
PlatformLinux, Mac, Windows
License:Apache License 2.0
Release Count0
Created At2017-10-05 17:32:00
Pushed At2023-11-20 09:13:34
Last Commit At
Stargazers Count26.1k
Watchers Count0.9k
Fork Count5.5k
Commits Count147
Has Issues Enabled
Issues Count925
Issue Open Count306
Pull Requests Count0
Pull Requests Open Count26
Pull Requests Close Count77
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

.. image:: https://codecov.io/github/ipython/ipython/coverage.svg?branch=master
:target: https://codecov.io/github/ipython/ipython?branch=master

.. image:: https://img.shields.io/pypi/v/IPython.svg
:target: https://pypi.python.org/pypi/ipython

.. image:: https://img.shields.io/travis/ipython/ipython.svg
:target: https://travis-ci.org/ipython/ipython

.. image:: https://www.codetriage.com/ipython/ipython/badges/users.svg
:target: https://www.codetriage.com/ipython/ipython/

.. image:: https://raster.shields.io/badge/Follows-NEP29-brightgreen.png
:target: https://numpy.org/neps/nep-0029-deprecation_policy.html

===========================================
IPython: Productive Interactive Computing

Overview

Welcome to IPython. Our full documentation is available on ipython.readthedocs.io <https://ipython.readthedocs.io/en/stable/>_ and contains information on how to install, use, and
contribute to the project.

IPython versions and Python Support

Starting with IPython 7.10, IPython follows NEP 29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>_

IPython 7.10+ requires Python version 3.6 and above.

IPython 7.0 requires Python version 3.5 and above.

IPython 6.x requires Python version 3.3 and above.

IPython 5.x LTS is the compatible release for Python 2.7.
If you require Python 2 support, you must use IPython 5.x LTS. Please
update your project configurations and requirements as necessary.

The Notebook, Qt console and a number of other pieces are now parts of Jupyter.
See the Jupyter installation docs <https://jupyter.readthedocs.io/en/latest/install.html>__
if you want to use these.

Development and Instant running

You can find the latest version of the development documentation on readthedocs <https://ipython.readthedocs.io/en/latest/>_.

You can run IPython from this directory without even installing it system-wide
by typing at the terminal::

$ python -m IPython

Or see the development installation docs <https://ipython.readthedocs.io/en/latest/install/install.html#installing-the-development-version>_
for the latest revision on read the docs.

Documentation and installation instructions for older version of IPython can be
found on the IPython website <https://ipython.org/documentation.html>_

IPython requires Python version 3 or above

Starting with version 6.0, IPython does not support Python 2.7, 3.0, 3.1, or
3.2.

For a version compatible with Python 2.7, please install the 5.x LTS Long Term
Support version.

If you are encountering this error message you are likely trying to install or
use IPython from source. You need to checkout the remote 5.x branch. If you are
using git the following should work::

$ git fetch origin
$ git checkout 5.x

If you encounter this error message with a regular install of IPython, then you
likely need to update your package manager, for example if you are using pip
check the version of pip with::

$ pip --version

You will need to update pip to the version 9.0.1 or greater. If you are not using
pip, please inquiry with the maintainers of the package for your package
manager.

For more information see one of our blog posts:

https://blog.jupyter.org/release-of-ipython-5-0-8ce60b8d2e8e

As well as the following Pull-Request for discussion:

https://github.com/ipython/ipython/pull/9900

This error does also occur if you are invoking setup.py directly – which you
should not – or are using easy_install If this is the case, use pip install . instead of setup.py install , and pip install -e . instead
of setup.py develop If you are depending on IPython as a dependency you may
also want to have a conditional dependency on IPython depending on the Python
version::

install_req = ['ipython']
if sys.version_info[0] < 3 and 'bdist_wheel' not in sys.argv:
    install_req.remove('ipython')
    install_req.append('ipython<6')

setup(
    ...
    install_requires=install_req
)

Alternatives to IPython

IPython may not be to your taste; if that's the case there might be similar
project that you might want to use:

  • the classic Python REPL.
  • bpython <https://bpython-interpreter.org/>_
  • mypython <https://www.asmeurer.com/mypython/>_
  • ptpython and ptipython <https://pypi.org/project/ptpython/>
  • xonsh <https://xon.sh/>

Ignoring commits with git blame.ignoreRevsFile

As of git 2.23, it is possible to make formatting changes without breaking
git blame. See the git documentation <https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile>_
for more details.

To use this feature you must:

  • Install git >= 2.23
  • Configure your local git repo by running:
    • POSIX: tools\configure-git-blame-ignore-revs.sh
    • Windows: tools\configure-git-blame-ignore-revs.bat
To the top