質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

2回答

541閲覧

chromedriverをインストールしたい

loulou098

総合スコア15

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2023/03/06 22:16

編集2023/03/06 22:22

seleniumをインストールした後、Homebrewを介してchromedriverをインストールしようとしましたが、以下のようにエラーが発生してしまいました。

python

1Error: 2 homebrew-core is a shallow clone. 3To `brew update`, first run: 4 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow 5This command may take a few minutes to run due to the large size of the repository. 6This restriction has been made on GitHub's request because updating shallow 7clones is an extremely expensive operation due to the tree layout and traffic of 8Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you 9automatically to avoid repeatedly performing an expensive unshallow operation in 10CI systems (which should instead be fixed to not use shallow clones). Sorry for 11the inconvenience! 12==> Tapping homebrew/cask

そこで、

python

1To `brew update`, first run: 2 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

とあることから、

python

1git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

を実行してみましたが、

python

1 File "/var/folders/jr/2p724fh51wv7fxmql7kxyb1h0000gn/T/ipykernel_78014/451855379.py", line 1 2 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow 3 ^ 4SyntaxError: invalid syntax

というエラーが出ました。

そこで、

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core

の部分を、ダブルコーテーションやシングルコーテンションをつけて、実行してみましたが両方ともエラーが出ました。

ダブルコーテーションの方は以下のエラーが出ました。

python

1 File "/var/folders/jr/2p724fh51wv7fxmql7kxyb1h0000gn/T/ipykernel_78014/547135465.py", line 1 2 git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow 3 ^ 4SyntaxError: invalid syntax

シングルコーテーションの方は以下のエラーが出ました。

python

1 File "/var/folders/jr/2p724fh51wv7fxmql7kxyb1h0000gn/T/ipykernel_78014/3092156648.py", line 1 2 git -C '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core' fetch --unshallow 3 ^ 4SyntaxError: invalid syntax

【質問】
他にはどのような解決策がありますか?

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

jbpb0

2023/03/06 23:29

> git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow をターミナルで実行してみました をやった時のスクショを、質問を編集して追加した方がいいと思います
guest

回答2

0

git -C ... を Python のコードとして実行しようとしているように見えます。ターミナルなどを開いてシェル上で実行しましょう。

投稿2023/03/06 22:22

int32_t

総合スコア20884

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

loulou098

2023/03/06 23:11

ご回答ありがとうございます。ご指摘いただいた通り、 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow をターミナルで実行してみましたが、 [I 2023-03-07 08:05:06.560 ServerApp] Saving file at /Untitled.ipynb と出てきました。
guest

0

自己解決

筆者はjupiterlab上でHomebrewを介してchromedriverをインストールしようとしていたが、回答者様のアドバイスがあり、ターミナル上で行なってみた。最初ターミナルで一連の動作を最初から行っていたが、プログラムが作動せず、無反応だった。しかしターミナルのアプリをダブルクリックし、「新しいウィンドウを開く」を押すことで、新しいタブができ、そこにプログラムを記述した。

brew install chromedriver

②エラーが以下のように出る。(本来はもっとコード量が多かったが、記述すると多すぎるので、最初の一部分を記述している)

Error: homebrew-core is a shallow clone. To `brew update`, first run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow This command may take a few minutes to run due to the large size of the repository. This restriction has been made on GitHub's request because updating shallow clones is an extremely expensive operation due to the tree layout and traffic of Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you automatically to avoid repeatedly performing an expensive unshallow operation in CI systems (which should instead be fixed to not use shallow clones). Sorry for the inconvenience! ==> Tapping homebrew/cask

③以下を実行

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

④その後、ユーザーパスワードの入力を要求されるので、記入。

投稿2023/03/07 21:30

loulou098

総合スコア15

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問