python Windows环境搭建,安装jupyter,ipython,pycharm

一 : Windows 版本程序下载


二:安装:勾选“Add Python 3.6 to PATH”,然后选择“Customize installation”。,一路next,只改动一下 ,安装路径为D:\SoftWare\Python\Python36 

三:自定义的Python 的安装目录 (D:\SoftWare\Python\Python36\Scripts),默认已经安装了pip,(pip 是通用的 Python 包管理工具。提供了对 Python 包的查找、下载、安装、卸载的功能)

四:安装部分辅助环境:Jupyter Notebook

切换到 D:\SoftWare\Python\Python36\Scripts目录下,命令行窗口输入: pip install jupyter

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>cd /d D:\

D:\>cd D:\SoftWare\Python\Python36\Scripts

D:\SoftWare\Python\Python36\Scripts>pip install jupyter


五:测试jupyter notebook  ,命令行窗口输入: jupyter notebook

同时,默认浏览器会打开 Jupyter notebook 窗口。 说明 Jupyter notebook 安装成功了。 

D:\SoftWare\Python\Python36\Scripts>jupyter notebook
[I 10:37:02.828 NotebookApp] Serving notebooks from local directory: D:\SoftWare
\Python\Python36\Scripts
[I 10:37:02.828 NotebookApp] 0 active kernels
[I 10:37:02.828 NotebookApp] The Jupyter Notebook is running at: http://localhos
t:8888/?token=8f82159edecad826ce9769f126402fc58f5b87b8d1050b0d
[I 10:37:02.829 NotebookApp] Use Control-C to stop this server and shut down all
 kernels (twice to skip confirmation).
[C 10:37:02.833 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=8f82159edecad826ce9769f126402fc58f5b87b8d10
50b0d
[I 10:37:03.628 NotebookApp] 302 GET / (::1) 1.00ms
[I 10:37:03.647 NotebookApp] 302 GET /tree? (::1) 5.00ms
[I 10:37:05.535 NotebookApp] Accepting one-time-token-authenticated connection f
rom ::1


六、配置 Jupyter notebook 

  运行之前,打开“.jupyter”文件夹,可以看到里面有个配置文件。 

cmd中,切换目录,并输入jupyter notebook --generate-config 即可生成默认配置

修改jupyter_notebook_config.py配置文件

  打开这个配置文件,找到“c.NotebookApp.notebook_dir=……”,把路径改成自己的工作目录。比如,这里要变更为

## The directory to use for notebooks and kernels.

c.NotebookApp.notebook_dir = 'D:\Code\jupyter-notebook',当然,文件夹 jupyter-notebook 需要自己创建好。 

配置文件修改完成后, 以后在 jupyter notebook 中写的代码等都会保存在自己创建的目录中。 

七:启动jupyter notebook的自定义启动

  配置文件修改成后,就可以启动 jupyter notebook 了,命令行窗口中输入 jupyter notebook

  默认浏览器就会打开一个页面 

对比修改默认配置前后的启动界面


八: 安装ipython  :        

ipython是一个python的交互式shell,比默认的python shell好用得多,支持变量自动补全,自动缩进,支持bash shell命令,内置了许多很有用的功能和函数。学习ipython将会让我们以一种更高的效率来使用python。同时它也是利用Python进行科学计算和交互可视化的一个最佳的平台。

        pip install ipython

如果我们也想在notebook中或者在Qt console中使用IPython,我们还需要安装Jupyter,(ipython环境),如下命令:

pip install jupyter

另外我们还可能需要安装一些用到的库:

NumPy高性能多维数组矢量运算库:

pip install numpy
  • 1

Matplotlib绘图以及交互式可视化:

pip install matplotlib



猜你喜欢

转载自blog.csdn.net/fflc2008/article/details/80995322