差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
python:ipython [2019/07/27 03:40] ともやんpython:ipython [2025/03/23 11:56] (現在) – [Linux] ともやん
行 1: 行 1:
-====== IPython のインストール ======+====== IPython ====== 
 +<WRAP #logo> 
 +{{python:ipython_logo.png?320|IPython Logo}} 
 +</WRAP> 
 +\\ 
 +本家: [[https://ipython.org/|Jupyter and the future of IPython — IPython]] [[gtr>https://ipython.org/|翻訳]]\\ 
 +ソースコード: [[https://github.com/ipython/ipython|ipython/ipython: Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.]] [[gtr>https://github.com/ipython/ipython|翻訳]]\\ 
 +ドキュメント: [[rtd>ipython.readthedocs.io/|IPython Documentation — IPython 8.22.2 documentation]] [[gtr>https://ipython.readthedocs.io/en/stable/|翻訳]]\\ 
 +\\ 
 +**IPython** (アイパイソン) は Python を対話的に実行するためのシェルである。CPython 内蔵の対話的に実行するためのシェルと比べ、型イントロスペクション (英語: Type introspection) 機能、対話的実行のための文法などが追加されてあり、コードのシンタックスハイライトおよびタブによる補完が行える。IPython の開発は NumFOCUS によって財政的に支援されている。\\ 
 +[[wwjp>IPython|IPython - Wikiwand]] より\\
  
-===== Linux ===== +===== インストール =====
-<code> +
-$ pip3 install ipython +
-</code>+
  
-===== Windows =====+==== Linux ==== 
 +<WRAP color_term> 
 +<WRAP color_command><html><pre> 
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">pip</font> install ipython 
 +</pre></html></WRAP> 
 +<WRAP color_result_hlong><html><pre> 
 +Defaulting to user installation because normal site-packages is not writeable 
 +Collecting ipython 
 +  Downloading ipython-9.0.2-py3-none-any.whl.metadata (4.3 kB) 
 +Collecting decorator (from ipython) 
 +  Downloading decorator-5.2.1-py3-none-any.whl.metadata (3.9 kB) 
 +Collecting ipython-pygments-lexers (from ipython) 
 +  Downloading ipython_pygments_lexers-1.1.1-py3-none-any.whl.metadata (1.1 kB) 
 +Collecting jedi&gt;=0.16 (from ipython) 
 +  Downloading jedi-0.19.2-py2.py3-none-any.whl.metadata (22 kB) 
 +Collecting matplotlib-inline (from ipython) 
 +  Downloading matplotlib_inline-0.1.7-py3-none-any.whl.metadata (3.9 kB) 
 +Collecting pexpect&gt;4.3 (from ipython) 
 +  Downloading pexpect-4.9.0-py2.py3-none-any.whl.metadata (2.5 kB) 
 +Collecting prompt_toolkit&lt;3.1.0,&gt;=3.0.41 (from ipython) 
 +  Downloading prompt_toolkit-3.0.50-py3-none-any.whl.metadata (6.6 kB) 
 +Collecting pygments&gt;=2.4.0 (from ipython) 
 +  Downloading pygments-2.19.1-py3-none-any.whl.metadata (2.5 kB) 
 +Collecting stack_data (from ipython) 
 +  Downloading stack_data-0.6.3-py3-none-any.whl.metadata (18 kB) 
 +Collecting traitlets&gt;=5.13.0 (from ipython) 
 +  Downloading traitlets-5.14.3-py3-none-any.whl.metadata (10 kB) 
 +Collecting parso&lt;0.9.0,&gt;=0.8.4 (from jedi&gt;=0.16-&gt;ipython) 
 +  Downloading parso-0.8.4-py2.py3-none-any.whl.metadata (7.7 kB) 
 +Collecting ptyprocess&gt;=0.5 (from pexpect&gt;4.3-&gt;ipython) 
 +  Downloading ptyprocess-0.7.0-py2.py3-none-any.whl.metadata (1.3 kB) 
 +Collecting wcwidth (from prompt_toolkit&lt;3.1.0,&gt;=3.0.41-&gt;ipython) 
 +  Downloading wcwidth-0.2.13-py2.py3-none-any.whl.metadata (14 kB) 
 +Collecting executing&gt;=1.2.0 (from stack_data-&gt;ipython) 
 +  Downloading executing-2.2.0-py2.py3-none-any.whl.metadata (8.9 kB) 
 +Collecting asttokens&gt;=2.1.0 (from stack_data-&gt;ipython) 
 +  Downloading asttokens-3.0.0-py3-none-any.whl.metadata (4.7 kB) 
 +Collecting pure-eval (from stack_data-&gt;ipython) 
 +  Downloading pure_eval-0.2.3-py3-none-any.whl.metadata (6.3 kB) 
 +Downloading ipython-9.0.2-py3-none-any.whl (600 kB) 
 +   <font color="#5FAF00">━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</font> <font color="#26A269">600.5/600.5 kB</font> <font color="#C01C28">11.7 MB/s</font> eta <font color="#2AA1B3">0:00:00</font> 
 +Downloading jedi-0.19.2-py2.py3-none-any.whl (1.6 MB) 
 +   <font color="#5FAF00">━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</font> <font color="#26A269">1.6/1.6 MB</font> <font color="#C01C28">11.7 MB/s</font> eta <font color="#2AA1B3">0:00:00</font> 
 +Downloading pexpect-4.9.0-py2.py3-none-any.whl (63 kB) 
 +Downloading prompt_toolkit-3.0.50-py3-none-any.whl (387 kB) 
 +Downloading pygments-2.19.1-py3-none-any.whl (1.2 MB) 
 +   <font color="#5FAF00">━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</font> <font color="#26A269">1.2/1.2 MB</font> <font color="#C01C28">11.8 MB/s</font> eta <font color="#2AA1B3">0:00:00</font> 
 +Downloading traitlets-5.14.3-py3-none-any.whl (85 kB) 
 +Downloading decorator-5.2.1-py3-none-any.whl (9.2 kB) 
 +Downloading ipython_pygments_lexers-1.1.1-py3-none-any.whl (8.1 kB) 
 +Downloading matplotlib_inline-0.1.7-py3-none-any.whl (9.9 kB) 
 +Downloading stack_data-0.6.3-py3-none-any.whl (24 kB) 
 +Downloading asttokens-3.0.0-py3-none-any.whl (26 kB) 
 +Downloading executing-2.2.0-py2.py3-none-any.whl (26 kB) 
 +Downloading parso-0.8.4-py2.py3-none-any.whl (103 kB) 
 +Downloading ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB) 
 +Downloading pure_eval-0.2.3-py3-none-any.whl (11 kB) 
 +Downloading wcwidth-0.2.13-py2.py3-none-any.whl (34 kB) 
 +Installing collected packages: wcwidth, pure-eval, ptyprocess, traitlets, pygments, prompt_toolkit, pexpect, parso, executing, decorator, asttokens, stack_data, matplotlib-inline, jedi, ipython-pygments-lexers, ipython 
 +Successfully installed asttokens-3.0.0 decorator-5.2.1 executing-2.2.0 ipython-9.0.2 ipython-pygments-lexers-1.1.1 jedi-0.19.2 matplotlib-inline-0.1.7 parso-0.8.4 pexpect-4.9.0 prompt_toolkit-3.0.50 ptyprocess-0.7.0 pure-eval-0.2.3 pygments-2.19.1 stack_data-0.6.3 traitlets-5.14.3 wcwidth-0.2.13 
 +</pre></html></WRAP> 
 +</WRAP> 
 + 
 +==== Windows ====
 <code> <code>
 > pip install ipython > pip install ipython
 </code> </code>
-<WRAP prewrap 100%>+<WRAP color_result_hlong>
 <code> <code>
 Collecting ipython Collecting ipython
行 66: 行 136:
 </WRAP> </WRAP>
  
-===== ipython の動作確認 =====+===== IPython の動作確認 =====
  
 ==== Linux ==== ==== Linux ====
-<code+<WRAP color_term
-$ ipython +<WRAP color_command><html><pre> 
-</code>+<font color="#0087FF"><b>$</b></font> <font color="#26A269">ipython</font> 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +Python 3.13.2 (main, Feb  4 2025, 00:00:00) [GCC 14.2.1 20250110 (Red Hat 14.2.1-7)] 
 +Type &apos;copyright&apos;, &apos;credits&apos; or &apos;license&apos; for more information 
 +IPython 9.0.2 -- An enhanced Interactive Python. Type &apos;?&apos; for help. 
 +Tip: You can find how to type a latex symbol by back completing it `\θ&lt;tab&gt;` will expand to `\theta`. 
 + 
 +<font color="#26A269">In [</font><font color="#33D17A"><b>1</b></font><font color="#26A269">]: </font> 
 +</pre></html></WRAP> 
 +</WRAP>
  
 ==== Windows ==== ==== Windows ====
行 77: 行 157:
 > ipython > ipython
 </code> </code>
 +<WRAP color_result_hlong>
 <code> <code>
 Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
行 278: 行 359:
 In [2]: In [2]:
 </code> </code>
 +</WRAP>
  
 +====== ☢️古い資料です (Obsolete)☢️ ======
 +
 +===== IPythonの導入 =====
 +  -pip を利用する場合、以下のコマンドを実行する。<code>
 +> pip install ipython pyreadline</code><WRAP prewrap 100% #result_long><code>
 +Downloading/unpacking ipython
 +  Downloading ipython-0.12.1.tar.gz (4.3Mb): 4.3Mb downloaded
 +  Running setup.py egg_info for package ipython
 +
 +    no previously-included directories found matching 'IPython\deathrow'
 +    no previously-included directories found matching 'IPython\frontend\html\notebook\static\mathjax'
 +    warning: no files found matching 'IPython\.git_commit_info.ini'
 +    warning: no previously-included files found matching 'docs\#*'
 +    warning: no previously-included files found matching 'docs\man\*.1.gz'
 +    no previously-included directories found matching 'docs\attic'
 +    no previously-included directories found matching 'docs\build'
 +    no previously-included directories found matching 'docs\gh-pages'
 +    no previously-included directories found matching 'docs\dist'
 +    warning: no previously-included files matching '*~' found anywhere in distribution
 +    warning: no previously-included files matching '*.flc' found anywhere in distribution
 +    warning: no previously-included files matching '*.pyo' found anywhere in distribution
 +    warning: no previously-included files matching '.dircopy.log' found anywhere in distribution
 +Downloading/unpacking pyreadline
 +  Downloading pyreadline-2.0-dev1.zip (109Kb): 109Kb downloaded
 +  Running setup.py egg_info for package pyreadline
 +
 +    package init file 'pyreadline\configuration\__init__.py' not found (or not a regular file)
 +Installing collected packages: ipython, pyreadline
 +  Running setup.py install for ipython
 +
 +    no previously-included directories found matching 'IPython\deathrow'
 +    no previously-included directories found matching 'IPython\frontend\html\notebook\static\mathjax'
 +    warning: no files found matching 'IPython\.git_commit_info.ini'
 +    warning: no previously-included files found matching 'docs\#*'
 +    warning: no previously-included files found matching 'docs\man\*.1.gz'
 +    no previously-included directories found matching 'docs\attic'
 +    no previously-included directories found matching 'docs\build'
 +    no previously-included directories found matching 'docs\gh-pages'
 +    no previously-included directories found matching 'docs\dist'
 +    warning: no previously-included files matching '*~' found anywhere in distribution
 +    warning: no previously-included files matching '*.flc' found anywhere in distribution
 +    warning: no previously-included files matching '*.pyo' found anywhere in distribution
 +    warning: no previously-included files matching '.dircopy.log' found anywhere in distribution
 +    Installing ipcontroller-script.py script to C:\Python27\Scripts
 +    Installing ipcontroller.exe script to C:\Python27\Scripts
 +    Installing ipcontroller.exe.manifest script to C:\Python27\Scripts
 +    Installing iptest-script.py script to C:\Python27\Scripts
 +    Installing iptest.exe script to C:\Python27\Scripts
 +    Installing iptest.exe.manifest script to C:\Python27\Scripts
 +    Installing ipcluster-script.py script to C:\Python27\Scripts
 +    Installing ipcluster.exe script to C:\Python27\Scripts
 +    Installing ipcluster.exe.manifest script to C:\Python27\Scripts
 +    Installing ipython-script.py script to C:\Python27\Scripts
 +    Installing ipython.exe script to C:\Python27\Scripts
 +    Installing ipython.exe.manifest script to C:\Python27\Scripts
 +    Installing pycolor-script.py script to C:\Python27\Scripts
 +    Installing pycolor.exe script to C:\Python27\Scripts
 +    Installing pycolor.exe.manifest script to C:\Python27\Scripts
 +    Installing iplogger-script.py script to C:\Python27\Scripts
 +    Installing iplogger.exe script to C:\Python27\Scripts
 +    Installing iplogger.exe.manifest script to C:\Python27\Scripts
 +    Installing irunner-script.py script to C:\Python27\Scripts
 +    Installing irunner.exe script to C:\Python27\Scripts
 +    Installing irunner.exe.manifest script to C:\Python27\Scripts
 +    Installing ipengine-script.py script to C:\Python27\Scripts
 +    Installing ipengine.exe script to C:\Python27\Scripts
 +    Installing ipengine.exe.manifest script to C:\Python27\Scripts
 +    Installing ipython-qtconsole-script.pyw script to C:\Python27\Scripts
 +    Installing ipython-qtconsole.exe script to C:\Python27\Scripts
 +    Installing ipython-qtconsole.exe.manifest script to C:\Python27\Scripts
 +  Running setup.py install for pyreadline
 +    package init file 'pyreadline\configuration\__init__.py' not found (or not a regular file)
 +
 +Successfully installed ipython pyreadline
 +Cleaning up...
 +</code></WRAP>
 +  - Windows の場合は C:\Python27\Scripts\ipython.exe へのショートカットを作成する。
 +
 +==== IPythonの導入(Windows編) =====
 +  - [[http://ipython.org/|IPython: Productive Interactive Computing — IPython]]の[[http://ipython.org/download.html|Download - IPython]]より、最新バージョンのインストーラをダウンロードする。\\ ここでは以下のファイルを使用する。
 +    * [[http://archive.ipython.org/release/|ipython-x.xx.x.win32-setup.exe]]
 +    * [[http://pypi.python.org/pypi/pyreadline#downloads|pyreadline-x.x-win32-setup.exe]]
 +  - ipython-x.xx.x.win32-setup.exe を実行してインストールを行う。
 +  - pyreadline-x.x-win32-setup.exe を実行してインストールを行う。
 +  - コマンドラインより動作確認を行う。<code>
 +> ipython
 +C:\Python26\lib\site-packages\IPython\Magic.py:38: DeprecationWarning: the sets module is deprecated
 +  from sets import Set
 +Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)]
 +Type "copyright", "credits" or "license" for more information.
 +
 +IPython 0.9.1 -- An enhanced Interactive Python.
 +?         -> Introduction and overview of IPython's features.
 +%quickref -> Quick reference.
 +help      -> Python's own help system.
 +object?   -> Details about 'object'. ?object also works, ?? prints more.
 +
 +In [1]:
 +</code>
 +  * 「DeprecationWarning: the sets module is deprecated」 は、sets モジュールが Python2.6 から非推奨であるため表示されている。\\ 2.6 は 3.0 への移行準備用バージョンであるためこのような警告が表示される。無視して構わない。
 +  * ここで ipython を実行しても以下のようなエラーになる場合<code>
 +> ipython
 +'ipython' は、内部コマンドまたは外部コマンド、
 +操作可能なプログラムまたはバッチ ファイルとして認識されていません。
 +</code>
 +C:\Python26;C:\Python26\Scripts; が環境変数のPATHに含まれていることを再度確認する。
  • python/ipython.1564166438.txt.gz
  • 最終更新: 2019/07/27 03:40
  • by ともやん