不多说,直接上干货!
前期博客 Windows下的Python 3.6.1的下载与安装(适合32bits和64bits)(图文详解)
这是我自定义的Python 的安装目录 (D:\SoftWare\Python\Python36\Scripts) 1、Jupyter Notebook 和 pip 为了更加方便地写 Python 代码,还需要安装 Jupyter notebook。 利用 pip 安装 Jupyter notebook。
pip: Python 的包管理工具,安装 Python 的同时已经安装好了。
2、Jupyter notebook 安装 命令行窗口输入: pip install jupyter 当然,若大家是默认安装的话,则在C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Scripts 目录下 。 或者将该目录添加到 path,就不用切换了。 我这里,因为考虑到机器学习深度学习那边,已经安装了Anaconda2和Anaconda3,所以这边的数据分析所用的python3.6.1就不添加到path了。每次去切换到这个目录来,也不麻烦。
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
安装成功。
3、 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 notebook 安装成功了。
4、配置 Jupyter notebook jupyter notebook --generate-config
运行之前
打开“.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>jupyter notebook --generate-config Writing default config to: C:\Users\Administrator\.jupyter\jupyter_notebook_conf ig.py D:\SoftWare\Python\Python36\Scripts>
修改jupyter_notebook_config.py配置文件
比如,这里要变更为 ## The directory to use for notebooks and kernels. ,当然,文件夹 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
现在是
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>jupyter notebook [I 10:59:58.326 NotebookApp] Serving notebooks from local directory: D:\Code\jup yter-notebook [I 10:59:58.327 NotebookApp] 0 active kernels [I 10:59:58.327 NotebookApp] The Jupyter Notebook is running at: http://localhos t:8888/?token=e520d165636db926b824bd77fe81559555ff679cc5fdc774 [I 10:59:58.328 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 10:59:58.332 NotebookApp] Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8888/?token=e520d165636db926b824bd77fe81559555ff679cc5f dc774 [I 10:59:59.532 NotebookApp] Accepting one-time-token-authenticated connection f rom ::1
当然,其实啊,这个玩意非常的简单和方便。关于修改名字、上传等操作,后续关注的我博客。
常见问题及解决方案 如何添加 Path? 单机“高级系统设置”
单机“环境变量”
找到系统变量 path,编辑
我的路径是已经改了,在下面的这篇博客里,可以看到 Windows下的Python 3.6.1的下载与安装(适合32bits和64bits)(图文详解)这是我自定义的Python 的安装目录 (D:\SoftWare\Python\Python36\Scripts)
jupyter notebook 闪退
欢迎大家,加入我的微信公众号:大数据躺过的坑 免费给分享
同时,大家可以关注我的个人博客: http://www.cnblogs.com/zlslch/ 和 http://www.cnblogs.com/lchzls/ 详情请见:http://www.cnblogs.com/zlslch/p/7473861.html
人生苦短,我愿分享。本公众号将秉持活到老学到老学习无休止的交流分享开源精神,汇聚于互联网和个人学习工作的精华干货知识,一切来于互联网,反馈回互联网。
以及对应本平台的QQ群:161156071(大数据躺过的坑)
|
|