jupyter notebook 寫程式碼自動補全
阿新 • • 發佈:2018-11-14
操作步驟
-
進入命令列環境。我使用的是conda。有兩種方式進入命令列。
<ul><li> <p>方法1:通過anconda navigator介面,選擇environments,選擇對應環境名,選擇open terminal</p> </li> <li> <p>方法2:直接使用cmd或者terminal等終端進入命令列。啟用你想要配置程式碼補全的環境(如果是預設環境不用啟用)</p> </li> </ul></li>
1.安裝nbextensions
-
pip
install jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple
-
jupyter contrib nbextension
install
--user
2.安裝nbextensions_configurator
-
pip
install
--user jupyter_nbextensions_configurator
-
jupyter nbextensions_configurator
enable
--user
-
如果提示缺少依賴,就使用pip安裝對應依賴即可。
-
重啟jupyter,在彈出的主頁面裡,能看到增加了一個Nbextensions標籤頁,在這個頁面裡,勾選Hinterland即啟用了程式碼自動補全,開啟一個notebook感受一下吧。
如果出現錯誤如下:
-
Installing collected packages: msgpack
-
Could not
install packages due
to an EnvironmentError: [WinError
5] 拒絕訪問。:
-
'E:\\JiangHeSong\\Anaconda35.2.0\\Lib\\site-packages\\msgpack\\_packer.cp36-win_
-
amd64.pyd'
-
Consider
using the
`--user`
option
or
check the permissions.
-
-
You
are
using pip
version
10.0
.1, however
version
18.0
is available.
-
You should
consider upgrading via the
'python -m pip install --upgrade pip' comm
-
and.
只需要加一個--user 例如:
pip install --user msgpack -i https://pypi.mirrors.ustc.edu.cn/simple
既可以正常安裝!!!
[轉載自](https://blog.csdn.net/weixin_37595559/article/details/81540482)
操作步驟