首先,執行以下命令:
pip install pip-autoremove
pip-auto remove jupyter -y
上面的命令其實是安裝了 pip-autoremove 這個庫,然后用 pip-autoremove 來刪除 jupyter 所依賴的相關庫。
這樣其實還沒有卸載干凈,我們還需要用 pip list
命令來查看和 jupyter 相關的庫,並且手動刪除相關的庫。可能需要刪除的庫如下所示:
pip uninstall jupyter -y
pip uninstall jupyter_core -y
pip uninstall jupyter-client -y
pip uninstall jupyter-console -y
pip uninstall notebook -y
pip uninstall qtconsole -y
pip uninstall nbconvert -y
pip uninstall nbformat -y
-y 在這里表示遇到需要選擇的選項全部選 y (yes)。
然后,在 cmd 命令行中進行如下操作:
即:
from jupyter_core.paths import jupyter_path
print(jupyter_path())
最后,將上面列出的所有相關的 jupyter 文件都刪除即可,這樣,再次安裝 jupyter notebook 就是全新的 jupyter notebook 了。