python 开发环境搭建
ipython是一个python的交互式shell,比默认的python shell好用得多,支持变量自动补全,自动缩进,支持bash shell命令,内置了许多很有用的功能和函数。学习ipython将会让我们以一种更高的效率来使用python。内部仍然是python.
IPython提供了两个主要的组件:
1.python交互式shell
2.供Jupyter notebooks使用的一个Jupyter内核(IPython notebook)
[D:\~]$ pip install ipython Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Requirement already satisfied: ipython in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (7.16.1) Requirement already satisfied: decorator in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from ipython) (4.4.2) Requirement already satisfied: jedi>=0.10 in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from ipython) (0.17.2) Requirement already satisfied: pygments in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from ipython) (2.6.1) Requirement already satisfied: colorama; sys_platform == "win32" in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from ipython) (0.4.3) Requirement already satisfied: pickleshare in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from ipython) (0.7.5) Requirement already satisfied: traitlets>=4.2 in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from ipython) (4.3.3) Requirement already satisfied: backcall in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from ipython) (0.2.0) Requirement already satisfied: setuptools>=18.5 in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from ipython) (39.0.1) Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from ipython) (3.0.6) Requirement already satisfied: parso<0.8.0,>=0.7.0 in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from jedi>=0.10->ipython) (0.7.1) Requirement already satisfied: ipython-genutils in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from traitlets>=4.2->ipython) (0.2.0) Requirement already satisfied: six in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from traitlets>=4.2->ipython) (1.15.0) Requirement already satisfied: wcwidth in c:\users\administrator\appdata\local\programs\python\python36\lib\site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython) (0.2.5) [D:\~]$ pip list Package Version ---------------- ------- backcall 0.2.0 colorama 0.4.3 decorator 4.4.2 ipython 7.16.1 ipython-genutils 0.2.0 jedi 0.17.2 parso 0.7.1 pickleshare 0.7.5 pip 20.2.2 prompt-toolkit 3.0.6 Pygments 2.6.1 setuptools 39.0.1 six 1.15.0 traitlets 4.3.3 wcwidth 0.2.5 [D:\~]$ ipython Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] Type 'copyright', 'credits' or 'license' for more information IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: exit [D:\~]$ pip install jupyter Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Collecting jupyter Downloading https://mirrors.aliyun.com/pypi/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB) Collecting notebook Downloading https://mirrors.aliyun.com/pypi/packages/ea/00/1be79c61e2dfedb29c430b0e08f9fd2cb6ee4f6be92ba6f185dd6bb00052/notebook-6.1.3-py3-none-any.whl (9.4 MB) …… [D:\~]$ jupyter -h usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [subcommand] Jupyter: Interactive Computing positional arguments: subcommand the subcommand to launch optional arguments: -h, --help show this help message and exit --version show the jupyter command's version and exit --config-dir show Jupyter config dir --data-dir show Jupyter data dir --runtime-dir show Jupyter runtime dir --paths show all Jupyter paths. Add --json for machine-readable format. --json output paths as machine-readable json Available subcommands: bundlerextension console kernel kernelspec migrate nbconvert nbextension notebook qtconsole run serverextension troubleshoot trust [D:\~]$ [D:\~]$ jupyter --version jupyter core : 4.6.3 jupyter-notebook : 6.1.3 qtconsole : 4.7.6 ipython : 7.16.1 ipykernel : 5.3.4 jupyter client : 6.1.6 jupyter lab : not installed nbconvert : 5.6.1 ipywidgets : 7.5.1 nbformat : 5.0.7 traitlets : 4.3.3 [D:\~]$ D:\~]$ jupyter-notebook -h The Jupyter HTML Notebook. This launches a Tornado based HTML Notebook Server that serves up an HTML5/Javascript Notebook client. D:\~]$ jupyter-notebook (缺省打开一个浏览器) [I 23:13:40.814 NotebookApp] Writing notebook server cookie secret to C:\Users\Administrator\AppData\Roaming\jupyter\runtime\notebook_cookie_secret [I 23:13:41.179 NotebookApp] Serving notebooks from local directory: D:\Users\Administrator\Documents\NetSarang Computer\6\Xshell\Sessions [I 23:13:41.179 NotebookApp] Jupyter Notebook 6.1.3 is running at: [I 23:13:41.179 NotebookApp] http://localhost:8888/?token=6b872883fb15402b310d34c592f998a5cb18821b0ef5aebb [I 23:13:41.179 NotebookApp] or http://127.0.0.1:8888/?token=6b872883fb15402b310d34c592f998a5cb18821b0ef5aebb [I 23:13:41.179 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 23:13:41.194 NotebookApp] To access the notebook, open this file in a browser: file:///C:/Users/Administrator/AppData/Roaming/jupyter/runtime/nbserver-4796-open.html Or copy and paste one of these URLs: http://localhost:8888/?token=6b872883fb15402b310d34c592f998a5cb18821b0ef5aebb or http://127.0.0.1:8888/?token=6b872883fb15402b310d34c592f998a5cb18821b0ef5aebb



浙公网安备 33010602011771号