安装好Brew后
安装Python3
- 在brew下查找python3
$ brew search python3
==> Formulae
boost-python3 python3 ✔ python@3 ✔ python@3.8
- 通过brew安装python3
$ brew install python3
Updating Homebrew...
Warning: python 3.7.7 is already installed, it's just not linked
You can use `brew link python` to link this version.
若未安装则会执行相关安装,已安装则提示未连接
3. 连接python
$ brew link --overwrite python
Linking /usr/local/Cellar/python/3.7.7... 28 symlinks created
通过pip安装Jupyter Notebook
- 查看python3版本
$ python3 -V
Python 3.6.7
- 安装pip
$ sudo easy_install pip
Password:
Searching for pip
Reading https://pypi.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/fe/3b/0fc5e63eb277d5a50a95ce5c896f742ef243be27382303a4a44dd0197e29/pip-20.2b1-py2.py3-none-any.whl#sha256=b4e230e2b8ece18c5a19b818f3c20a8d4eeac8172962779fd9898d7c4ceb1636
Best match: pip 20.2b1
Processing pip-20.2b1-py2.py3-none-any.whl
Installing pip-20.2b1-py2.py3-none-any.whl to /Library/Python/2.7/site-packages
Adding pip 20.2b1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip3.8 script to /usr/local/bin
Installing pip3 script to /usr/local/bin
Installed /Library/Python/2.7/site-packages/pip-20.2b1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
- 更换pip源至国内阿里云的源(也可选择其它源)
$ pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
Writing to /Users/nd/.config/pip/pip.conf
其它镜像
- 豆瓣
https://pypi.doubanio.com/simple/ - 阿里云
https://mirrors.aliyun.com/pypi/simple/ - 清华大学
https://pypi.tuna.tsinghua.edu.cn/simple/
https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/
- 安装jupyter Notebook
$ pip3 install jupyter notebook
- 启动jupyter Notebook
$ python3 -m IPython notebook
大功告成!可以愉快滴开始我们的Python之旅啦!