0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windowsでbertopicをインストールできない場合の対処法

Posted at

BERTopicをインストールする際に以下エラーが出ました。

Building wheels for collected packages: hdbscan
  Building wheel for hdbscan (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for hdbscan (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [26 lines of output]
  ...
  (中略)
  ...

      building 'hdbscan._hdbscan_tree' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for hdbscan
Failed to build hdbscan
ERROR: Failed to build installable wheels for some pyproject.toml based projects (hdbscan)

このエラーは、必要な開発ツールが不足していることが原因でした。以下の手順で解決できます:

  1. まず、Visual Studio Build Toolsをインストールします:
    1. https://visualstudio.microsoft.com/ja/visual-cpp-build-tools/ にアクセス
    2. 「Visual Studio Build Tools 2022」をダウンロード
    3. インストーラーを実行し、「C++によるデスクトップ開発」を選択してインストール

2 . BERTopicをインストール:

pip install --upgrade pip
pip install bertopic

もし特定のエラーが発生する場合は、以下の順序でインストールを試してください:

pip install hdbscan
pip install umap-learn
pip install bertopic

注意点:

  • Python 3.7以上が必要です
  • インストール中に一時的にCPU使用率が高くなる可能性があります
  • メモリを十分に確保してください(最低4GB推奨)

エラーが続く場合は、エラーメッセージを共有していただければ、より具体的な解決方法をご案内できます。

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?