LoginSignup
17
11

More than 3 years have passed since last update.

Jupyter Notebookで(y/n)?の対処法

Posted at

概要

Jupyter Notebookでなにかをアンインストールしたりするときに

!pip uninstall "アンインストールするもの"

これを実行すると

Found existing installation:
Uninstalling :
  Would remove:
    /Users/usr/Library/Python/3.9/lib/python/site-packages/
"Proceed (y/n)?"

上の" "で囲まれているような
返答が必要なものが返ってくることがあります
今回はそれの対処法について説明します

対処法

!echo (y or n) |をつけることです!

実際に使うとこんな感じ

!echo y | pip uninstall "アンインストールするもの"

echoはコマンドなのでjupyter notebookで使用するときは
はじめに!を付ける必要があります

これでshift+Enterで対応できます
n(no)であればyの部分をnに変えてください

まとめ

Proceed (y/n)?#これの返事をしたければ

!echo (y/n) | pip uninstall "アンインストールするもの"
17
11
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
11