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

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

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

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

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

Google

Googleは、アメリカ合衆国に位置する、インターネット関連のサービスや製品を提供している企業です。検索エンジンからアプリケーションの提供まで、多岐にわたるサービスを提供しています。

Q&A

1回答

1250閲覧

google-image-downloadの使い方(Mac,VS code)

_mini

総合スコア15

Python

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

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

Google

Googleは、アメリカ合衆国に位置する、インターネット関連のサービスや製品を提供している企業です。検索エンジンからアプリケーションの提供まで、多岐にわたるサービスを提供しています。

0グッド

0クリップ

投稿2020/07/02 08:48

編集2020/07/05 01:20

vs codeで画像分類器作成の演習のためにgoogle-image-downloaderをpipでインストールして画像をダウンロード
しようと思ったのですが、下記のエラー文が出てきて画像を取得できません。
teratail内での質問も拝見しましたが、回答者様の端末では実行できたとの回答が多く、根本的な解決策がないように感じたので質問させていただきます。

googleimagesdownload -k '二郎系ラーメン' -l 20 Item no.: 1 --> Item name = \u4e8c\u90ce\u7cfb\u30e9\u30fc\u30e1\u30f3 Evaluating... Starting Download... Unfortunately all 20 could not be downloaded because some images were not downloadable. 0 is all we got for this search filter! Errors: 0 Everything downloaded! Total errors: 0 Total time taken: 0.9890496730804443 Seconds

これはvs codeのpythonのプログラム内になにかimportしたり、pipインストールがうまく行かないことなどもあったりするのでしょうか?

使用しているPCは
MacBook Pro (13-inch, 2019, Two Thunderbolt 3 ports)
プロセッサ 1.4 GHz クアッドコアIntel Core i5
メモリ 8 GB 2133 MHz LPDDR3

環境は
vs code
python3.7.6
tensorflow1.14.0

エラー文全体です

(base) xxxxxxx@xxxxxx image-classfication-jiro % python -m pip install git+https://github.com/Joeclinton1/google-images-download.git Collecting git+https://github.com/Joeclinton1/google-images-download.git Cloning https://github.com/Joeclinton1/google-images-download.git to /private/var/folders/m8/1ppphl5160z71yqgl_25lh_00000gn/T/pip-req-build-_t0k9agu Running command git clone -q https://github.com/Joeclinton1/google-images-download.git /private/var/folders/m8/1ppphl5160z71yqgl_25lh_00000gn/T/pip-req-build-_t0k9agu Requirement already satisfied (use --upgrade to upgrade): google-images-download==2.8.0 from git+https://github.com/Joeclinton1/google-images-download.git in /opt/anaconda3/lib/python3.7/site-packages Requirement already satisfied: selenium in /opt/anaconda3/lib/python3.7/site-packages (from google-images-download==2.8.0) (3.141.0) Requirement already satisfied: urllib3 in /opt/anaconda3/lib/python3.7/site-packages (from selenium->google-images-download==2.8.0) (1.25.8) Building wheels for collected packages: google-images-download Building wheel for google-images-download (setup.py) ... done Created wheel for google-images-download: filename=google_images_download-2.8.0-py2.py3-none-any.whl size=15385 sha256=426ebc6202f8004004f799aa0e46284e9b37ddb47e203c126c89e2157f773bc6 Stored in directory: /private/var/folders/m8/1ppphl5160z71yqgl_25lh_00000gn/T/pip-ephem-wheel-cache-wbn6xvwp/wheels/79/5c/d2/2569a4f55ff29b3c4d6b1114d5110a70a79afbf381e6eb3e87 Successfully built google-images-download ERROR: Error checking for conflicts. Traceback (most recent call last): File "/opt/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3021, in _dep_map return self.__dep_map File "/opt/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2815, in __getattr__ raise AttributeError(attr) AttributeError: _DistInfoDistribution__dep_map During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3012, in _parsed_pkg_info return self._pkg_info File "/opt/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2815, in __getattr__ raise AttributeError(attr) AttributeError: _pkg_info During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/anaconda3/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 512, in _warn_about_conflicts package_set, _dep_info = check_install_conflicts(to_install) File "/opt/anaconda3/lib/python3.7/site-packages/pip/_internal/operations/check.py", line 114, in check_install_conflicts package_set, _ = create_package_set_from_installed() File "/opt/anaconda3/lib/python3.7/site-packages/pip/_internal/operations/check.py", line 53, in create_package_set_from_installed package_set[name] = PackageDetails(dist.version, dist.requires()) File "/opt/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2736, in requires dm = self._dep_map File "/opt/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _dep_map self.__dep_map = self._compute_dependencies() File "/opt/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3032, in _compute_dependencies for req in self._parsed_pkg_info.get_all('Requires-Dist') or []: File "/opt/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3014, in _parsed_pkg_info metadata = self.get_metadata(self.PKG_INFO) File "/opt/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1420, in get_metada ta value = self._get(path) File "/opt/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1616, in _get with open(path, 'rb') as stream: FileNotFoundError: [Errno 2] No such file or directory: '/opt/anaconda3/lib/python3.7/site-packages/google_pasta-0.2.0.dist-info/METADATA'

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

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

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

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

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

guest

回答1

0

google-image-downloaderをアンインストールし、以下を実行してください。

shell

1python -m pip install git+https://github.com/Joeclinton1/google-images-download.git

公式のissueによると、1週間前にpatchがついているみたいですが、pipにまだ反映されていないのかもしれません。
https://github.com/hardikvasa/google-images-download/pull/298#issuecomment-652669622

こういう類のものは、githubのissueを確認するといいです。
しばらくするとpipにも反映されると思いますが、しばらくはこれで凌ぐといいと思います。

投稿2020/07/03 18:38

編集2020/07/03 18:49
Penpen7

総合スコア698

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

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

_mini

2020/07/04 04:12

一度アンインストールし、教えていただいたコードを入力してみたのですが、結果は変わらなかったです…
Penpen7

2020/07/04 09:25

私の方は使えたのですが…
Penpen7

2020/07/04 12:22

私が行った手順は以下の通りです。 1. pip uninstall google-images-download 2. python -m pip install git+https://github.com/Joeclinton1/google-images-download.git もしくは上のコマンドでダメな場合は python -m pip install git+https://github.com/Joeclinton1/google-images-download.git@patch-1 でブランチを明示する。 3. インストール後、端末を開き直す 4. googleimagesdownload -k '二郎系ラーメン' -l 20 5. Downloadsディレクトリに画像がダウンロードされる。
_mini

2020/07/04 13:40

どちらのコマンドを入力しても下記のようなエラー文がでてきて、インストールがうまくいっていないようです。 FileNotFoundError: [Errno 2] No such file or directory: '/opt/anaconda3/lib/python3.7/site-packages/google_pasta-0.2.0.dist-info/METADATA'
Penpen7

2020/07/04 15:43

FileNotFoundError: [Errno 2] No such file or directory: '/opt/anaconda3/lib/python3.7/site-packages/google_pasta-0.2.0.dist-info/METADATA' はどこで発生するエラーでしょうか?
_mini

2020/07/05 01:18

2番のコマンドを打った際に、最後の方はほぼ赤くエラーになっているのですが、その中で一番最後に表示されているエラーです。
_mini

2020/07/05 01:20

エラー文全体を質問に編集いたしました。
Penpen7

2020/07/05 09:07

私はconda環境下で実行していないので、どうなっているかわからないですね... アンインストールはされましたか?
_mini

2020/07/06 12:08

アンインストールしてみましたが、最初のインストールの段階でエラーが出ていたのでpipでもうまくインストールできていなかったようです。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問