Mac10.13如何安装Python-3.6.8和IPython-Notebook
小编给大家分享一下Mac 10.13如何安装Python-3.6.8和IPython-Notebook,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
成都创新互联公司专注于桃山企业网站建设,自适应网站建设,商城网站建设。桃山网站建设公司,为桃山等地区提供建站服务。全流程按需求定制制作,专业设计,全程项目跟踪,成都创新互联公司专业和态度为您提供的服务
一、安装 Python-3.6.8
我用的 3.6.8 版本,你也可以安装其他版本,方法相同。
1.1 查看 Mac CPU 位数
uname -a
Darwin MacdeAir 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
x86_64 表示 64 位,否则是 32 位,后面需要下载对应位数的安装包。
1.2 查看当前默认 Python 环境
python
Python 2.7.10 (default, Oct 6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
我的电脑默认安装了 Python-2.7,因为有些软件依赖 2.7 版本,所以不要卸载 2.7,我们直接安装 3.6.8 版本。
1.3 官网下载 Python-3.6.x
下载地址:
https://www.python.org/downloads/
选择合适的版本下载,我选择的是 3.6.8:

因为我的电脑是 64 位的,所以这里下载 macOS 64-bit installer:

下载完成后,双击安装包,一路继续就可以了:

1.4 查看是否安装成功
python3
Python 3.6.8 (v3.6.8:3c6b436a57, Dec 24 2018, 02:04:31)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
打印 3.6.8 版本信息,说明 Python 3 安装成功了!
二、安装 IPython-Notebook
因为科学计算的许多项目代码都是用 IPython-Notebook 发布的,所以这里也需要安装,用来打开 ipynb
文件。
2.1 安装 Jupyter
一行命令即可安装,注意 Python3 用的是 pip3:
pip3 install --user jupyter

等待安装完毕即可。
2.2 打开 IPython-Notebook
在终端中用命令打开:
python3 -m IPython notebook
打开成功后,会自动打开浏览器并跳到软件界面:

之后就可以写代码调试了 ^_^:

搞定!
以上是“Mac 10.13如何安装Python-3.6.8和IPython-Notebook”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!
文章标题:Mac10.13如何安装Python-3.6.8和IPython-Notebook
文章源于:http://pwwzsj.com/article/pdpcdd.html