首先切换 root 用户:
sudo su -
pip3 自动安装 ipython
yuchaodeMacBook-Pro:~ root# pip3 install ipython
自动安装完成后建立软连接, 方便使用
yuchaodeMacBook-Pro:bin root# ln -s /Library/Frameworks/Python.framework/Versions/3.6/bin/ipython /usr/local/bin/
成功安装, 执行使用
- yuchaodeMacBook-Pro:bin root# ipython
- Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
- Type 'copyright', 'credits' or 'license' for more information
- IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
- In [1]: name = 'chaoge'
- In [2]: name
- Out[2]: 'chaoge'
- In [3]:
安装 jupyter notebook
1. 激活虚拟环境 venv
- 2. pip3 install ipython
- pip3 install jupyter
3. ipython 进入
- from IPython.lib import passwd
- passwd()# 生成密码
- 4.jupyter notebook --generate-config --allow-root
- c.NotebookApp.ip = '0.0.0.0'
- c.NotebookApp.open_browser = False
- c.NotebookApp.password = 'sha1:4d75995b2f75:c08ada6f31047fe429d0b24652f8fbc81ec32a7c'
- c.NotebookApp.port = 8000
- 5.jupyter notebook --allow-root #启动 notebook
来源: http://www.bubuko.com/infodetail-2961714.html