1. 程式人生 > >jupyter notebook 寫程式碼自動補全

jupyter notebook 寫程式碼自動補全

操作步驟

  1. 進入命令列環境。我使用的是conda。有兩種方式進入命令列。

    <ul><li>
    	<p>方法1:通過anconda navigator介面,選擇environments,選擇對應環境名,選擇open terminal</p>
    	</li>
    	<li>
    	<p>方法2:直接使用cmd或者terminal等終端進入命令列。啟用你想要配置程式碼補全的環境(如果是預設環境不用啟用)</p>
    	</li>
    </ul></li>
    

1.安裝nbextensions 


  
  1. pip install jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple
  2. jupyter contrib nbextension install --user

2.安裝nbextensions_configurator


  
  1. pip install --user jupyter_nbextensions_configurator
  2. jupyter nbextensions_configurator enable --user
  1. 如果提示缺少依賴,就使用pip安裝對應依賴即可。

  2. 重啟jupyter,在彈出的主頁面裡,能看到增加了一個Nbextensions標籤頁,在這個頁面裡,勾選Hinterland即啟用了程式碼自動補全,開啟一個notebook感受一下吧。

 

 

 

如果出現錯誤如下:


  
  1. Installing collected packages: msgpack
  2. Could not install packages due to an EnvironmentError: [WinError 5] 拒絕訪問。:
  3. 'E:\\JiangHeSong\\Anaconda35.2.0\\Lib\\site-packages\\msgpack\\_packer.cp36-win_
  4. amd64.pyd'
  5. Consider using the `--user` option or check the permissions.
  6. You are using pip version 10.0 .1, however version 18.0 is available.
  7. You should consider upgrading via the 'python -m pip install --upgrade pip' comm
  8. and.

 只需要加一個--user 例如:

pip install --user msgpack -i https://pypi.mirrors.ustc.edu.cn/simple
  

既可以正常安裝!!!

 

 

[轉載自](https://blog.csdn.net/weixin_37595559/article/details/81540482)

操作步驟