単語抽出ツール(2):単語抽出ツール実行環境の構成

単語抽出ツールはPythonで開発されたツールであり、実行前にPythonや必要なpackageインストールなどの環境構成プロセスが必要です。単語抽出ツールの実行環境構成について見てください。

前の記事で続く内容だ。

単語抽出ツール(1):単語抽出ツールの概要

<<目次>>

2. 単語抽出ツール実行環境の構成

2.1。環境構成の概要

2.1.1.推奨事項

AnacondaではなくMinicondaのインストールをお勧めします。 Anacondaは、あまりにも多くのパッケージを基本環境に設置して容量が大きい。容量が小さくて軽く始められるMinicondaを使うのが良い。

Minicondaをインストールしていない場合は、virtualenvのインストールをお勧めします。基本環境と隔離された別の環境にpackageをインストールすると、packageのバージョン競合問題などを避けることができる。

もしあまり問題がないと判断されたり、単語抽出器だけを使用する場合、基本環境を使っても構わない。この記事では、Windows 10 64bitでMinicondaを使用する方法について説明します。

2.1.2。形態素分析器の選択: Mecab

Mecabは、公開されている自然言語形態素アナライザの中で実行が最も速く、単語抽出という目的に最も適合して選択した。 Mecab以外の形態素アナライザを使用するには、get_word_list()関数を修正して使用します。

2.1.3。環境構成全体の順序

  1. Minicondaのインストール
  2. 仮想環境の作成、有効化
  3. 仮想環境にPythonをインストールする
  4. 仮想環境に必要なパッケージのインストール(仮想環境を使用しない場合は基本環境にインストール)

2.2. Minicondaのインストール

https://conda.io/en/latest/miniconda.html#windows-installers からPythonバージョンを選択してダウンロードします。単語抽出ツールはPython 3.8で開発され、3.9でもうまく動作します。ここでは3.9をダウンロードしてインストールします。

Miniconda Windows Installers version
Miniconda Windowsインストーラバージョン

ダウンロードしたファイル(Miniconda3-py39_4.10.3-Windows-x86_64.exe)を実行してインストールを進めます。 Nextボタンを数回クリックするとインストールが完了します。

Miniconda 설치 화면
Minicondaインストール画面

その後の作業はMiniconda Promptで実行されます。次のパスで実行できます。

スタートメニュー> Anaconda3(64bit)> Anaconda Prompt(miniconda3)

Miniconda Prompt 실행
Miniconda Promptの実行

2.3。仮想環境の作成、有効化

Miniconda Promptを初めて実行すると、基本環境(base)が有効になります。 (上記画像参照)

単語抽出ツール用の別々の仮想環境を作成します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
(base) C:\Users\ymlee>conda create -n wordextr
(base) C:\Users\ymlee>conda create -n wordextr
(base) C:\Users\ymlee>conda create -n wordextr

次のコマンドで作成した仮想環境を有効にします。命令実行後に仮想環境名(wordextr)が前に見えれば正常に活性化されたものである。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
(base) C:\Users\ymlee>conda activate wordextr
(wordextr) C:\Users\ymlee>
(base) C:\Users\ymlee>conda activate wordextr (wordextr) C:\Users\ymlee>
(base) C:\Users\ymlee>conda activate wordextr
(wordextr) C:\Users\ymlee>

2.4。仮想環境にPythonをインストールする

次の命令を実行します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
(wordextr) C:\Users\ymlee>conda install python
(wordextr) C:\Users\ymlee>conda install python
(wordextr) C:\Users\ymlee>conda install python

以下の内容が出力される。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
(wordextr) C:\Users\ymlee>conda install python
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: C:\Users\ymlee\miniconda3\envs\wordextr
added / updated specs:
- python
The following NEW packages will be INSTALLED:
ca-certificates pkgs/main/win-64::ca-certificates-2021.7.5-haa95532_1
certifi pkgs/main/win-64::certifi-2021.5.30-py39haa95532_0
openssl pkgs/main/win-64::openssl-1.1.1l-h2bbff1b_0
pip pkgs/main/win-64::pip-21.2.4-py38haa95532_0
python pkgs/main/win-64::python-3.9.7-h6244533_1
setuptools pkgs/main/win-64::setuptools-58.0.4-py39haa95532_0
sqlite pkgs/main/win-64::sqlite-3.36.0-h2bbff1b_0
tzdata pkgs/main/noarch::tzdata-2021a-h5d7bf9c_0
vc pkgs/main/win-64::vc-14.2-h21ff451_1
vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.27.29016-h5e58377_2
wheel pkgs/main/noarch::wheel-0.37.0-pyhd3eb1b0_1
wincertstore pkgs/main/win-64::wincertstore-0.2-py39h2bbff1b_0
Proceed ([y]/n)?
(wordextr) C:\Users\ymlee>conda install python Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: C:\Users\ymlee\miniconda3\envs\wordextr added / updated specs: - python The following NEW packages will be INSTALLED: ca-certificates pkgs/main/win-64::ca-certificates-2021.7.5-haa95532_1 certifi pkgs/main/win-64::certifi-2021.5.30-py39haa95532_0 openssl pkgs/main/win-64::openssl-1.1.1l-h2bbff1b_0 pip pkgs/main/win-64::pip-21.2.4-py38haa95532_0 python pkgs/main/win-64::python-3.9.7-h6244533_1 setuptools pkgs/main/win-64::setuptools-58.0.4-py39haa95532_0 sqlite pkgs/main/win-64::sqlite-3.36.0-h2bbff1b_0 tzdata pkgs/main/noarch::tzdata-2021a-h5d7bf9c_0 vc pkgs/main/win-64::vc-14.2-h21ff451_1 vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.27.29016-h5e58377_2 wheel pkgs/main/noarch::wheel-0.37.0-pyhd3eb1b0_1 wincertstore pkgs/main/win-64::wincertstore-0.2-py39h2bbff1b_0 Proceed ([y]/n)?
(wordextr) C:\Users\ymlee>conda install python
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\ymlee\miniconda3\envs\wordextr

  added / updated specs:
    - python


The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/win-64::ca-certificates-2021.7.5-haa95532_1
  certifi            pkgs/main/win-64::certifi-2021.5.30-py39haa95532_0
  openssl            pkgs/main/win-64::openssl-1.1.1l-h2bbff1b_0
  pip                pkgs/main/win-64::pip-21.2.4-py38haa95532_0
  python             pkgs/main/win-64::python-3.9.7-h6244533_1
  setuptools         pkgs/main/win-64::setuptools-58.0.4-py39haa95532_0
  sqlite             pkgs/main/win-64::sqlite-3.36.0-h2bbff1b_0
  tzdata             pkgs/main/noarch::tzdata-2021a-h5d7bf9c_0
  vc                 pkgs/main/win-64::vc-14.2-h21ff451_1
  vs2015_runtime     pkgs/main/win-64::vs2015_runtime-14.27.29016-h5e58377_2
  wheel              pkgs/main/noarch::wheel-0.37.0-pyhd3eb1b0_1
  wincertstore       pkgs/main/win-64::wincertstore-0.2-py39h2bbff1b_0


Proceed ([y]/n)?

ただエンターキーを押すか、yを入力してエンターキーを押すとインストールが始まります。ちなみに、インストールしない場合は、n入力後にEnterキーを押します。

2.5。必要なパッケージのインストール

次の命令で必要なパッケージをインストールする。 wordcloud、eunjeonはcondaによって提供されないのでpipとしてインストールされなければならない。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
conda install pywin32
conda install pandas
conda install Jinja2
conda install xlsxwriter
pip install wordcloud
pip install eunjeon
conda install pywin32 conda install pandas conda install Jinja2 conda install xlsxwriter pip install wordcloud pip install eunjeon
conda install pywin32
conda install pandas
conda install Jinja2
conda install xlsxwriter
pip install wordcloud
pip install eunjeon

各パッケージの用途は次のとおりです。

  • pywin32:MS Word、PowerPoint、ExcelファイルをOLE automation方式で開いて読み込むために使用
  • pandas:単語抽出結果をメモリで管理し、最後にExcelファイルに保存するために使用
  • Jinja2、xlsxwriter:pandasでExcelWriterに使用
  • wordcloud:単語抽出結果を視覚化するために使用
  • eunjeon: 韓国語形態素アナライザ Mecab を使う

eunjeonのインストール時に「Microsoft Visual C++ 14.0 or greater is required.」エラーが発生した場合は、以下のURLから「再頒布可能パッケージとビルドツール」のうち「Microsoft Build Tools 2015 Update 3」をダウンロードしてインストールして再試行してください。

https://visualstudio.microsoft.com/ko/vs/older-downloads/#microsoft-build-tools-2015-update-3

インストール時に「C++を使ったデスクトップ開発」を選択してインストールする。 (下の画面はインストール後にキャプチャした画面で、インストール時の画面とは若干異なります)

Microsoft Build Tools 2015 업데이트 3 설치
Microsoft Build Tools 2015 Update 3のインストール

「Microsoft Build Tools 2015 Update 3」インストールが完了したら、次のコマンドでeunjeonをインストールします。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
pip install eunjeon
pip install eunjeon
pip install eunjeon

eunjeonのインストールが完了したら、「Microsoft Build Tools 2015 Update 3」は削除できます。

スタートメニューから「Visual Studio Installer」を実行し、「C++を使ったデスクトップ開発」の選択解除、右下の「修正」ボタンをクリックして削除する。

Visual Studio Installer 실행
Visual Studioインストーラの実行
Microsoft Build Tools 2015 업데이트 3 제거
Microsoft Build Tools 2015 Update 3 の削除

ここまで進めば環境構成は完了した。次に、単語抽出ツールの実行と結果を確認する方法について説明します。


<< 関連記事のリスト >>

7件のフィードバック

  1. アバター写真 김철민 より:

    (wordextr) E:\WordExtractor>python word_extractor.py –in_path .\in –out_path .\out
    pythonを初めて使う初心者ですㅠㅠ。上記のように実行しましたが、以下のような結果が出ました。何かパス指定が間違っているようですが、この初心者が解決できませんね。助けてくれてありがとう(正確にin、outフォルダは作られています)。

    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    ————————————————————
    Word Extractor v0.41 start — 2023-11-20 03:13:07.584787
    ##### arguments #####
    multi_process_count: 32
    db_comment_file: None
    in_path: .\in
    out_path: .\out
    ————————————————————
    [2023-11-20 03:13:07.586789] Start Get File List…
    [2023-11-20 03:13:07.586789] Finish Get File List.
    — File List —
    E:\WordExtractor\in\test.txt
    [2023-11-20 03:13:07.588790] Start Get File Text…
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')
    E:\WordExtractor\word_extractor.py:382: SyntaxWarning: invalid escape sequence '\o'
    usage_description = “””— Description —
    E:\WordExtractor\word_extractor.py:406: SyntaxWarning: invalid escape sequence '\i'
    parser.add_argument('–in_path', required=False, help='入力ファイル(ppt, doc, txt) パス名 (例: .\in) ')
    E:\WordExtractor\word_extractor.py:407: SyntaxWarning: invalid escape sequence '\o'
    parser.add_argument('–out_path', required=True, help='出力ファイル(xlsx, png) パス名(例: .\out)')

    get_txt_text: E:\WordExtractor\in\test.txt
    multiprocessing.pool.RemoteTraceback:
    “””
    Traceback (most recent call last):
    File “C:\ProgramData\miniconda3\envs\wordextr\Lib\multiprocessing\pool.py”, line 125, in worker
    result = (True, func(*args, **kwds))
    ^^^^^^^^^^^^^^^^^^^
    File “C:\ProgramData\miniconda3\envs\wordextr\Lib\multiprocessing\pool.py”, line 48, in mapstar
    return list(map(*args))
    ^^^^^^^^^^^^^^^^
    File “E:\WordExtractor\word_extractor.py”, line 367, in get_file_text
    df_text = get_txt_text(file_name)
    ^^^^^^^^^^^^^^^^^^^^^^^
    File “E:\WordExtractor\word_extractor.py”, line 238, in get_txt_text
    df_text = df_text.append(sr_text, ignore_index=True)
    ^^^^^^^^^^^^^^
    File “C:\ProgramData\miniconda3\envs\wordextr\Lib\site-packages\pandas\core\generic.py”, line 6204, in __getattr__
    return object.__getattribute__(self, name)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'?
    “””

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
    File “E:\WordExtractor\word_extractor.py”, line 559, in
    main()
    File “E:\WordExtractor\word_extractor.py”, line 460, in main
    mp_text_result = pool.map(get_file_text, file_list)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File “C:\ProgramData\miniconda3\envs\wordextr\Lib\multiprocessing\pool.py”, line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File “C:\ProgramData\miniconda3\envs\wordextr\Lib\multiprocessing\pool.py”, line 774, in get
    raise self._value
    AttributeError: 'DataFrame' object has no attribute 'append'

    (wordextr) E:\WordExtractor>

    • アバター写真 Zerom より:

      こんにちは、嬉しいです。
      私が経験できなかったエラーなので、すぐに解決方法をお知らせするのが難しいですね。
      Python versionとnumpy、pandasのバージョンを確認して教えてください。
      versionが違うので確認が必要だと思います。

      ちなみに、私が実装してテストした環境のバージョンは次のとおりです。
      – Python: 3.9.6 (確認方法: python –version)
      – numpy: 1.20.3 (確認方法: pip list) (下記のパンダも一度に確認できます)
      – pandas: 1.3.1

    • アバター写真 서희경 より:

      私も同じエラーが出ました。共有したパッケージのバージョンを合わせて実行したところ、成功しました。

  2. アバター写真 서희경 より:

    こんにちは。アナコンダのインストールに関して質問があります。会社内部で単語抽出ツールを使ってみたいのですが、アナコンダが有料化され、会社ではminiforgeの使用を推奨しています。 miniforgeのインストール後に単語抽出ツールを使用しても機能に違いはありませんか?

    • アバター写真 Zerom より:

      私はminiforgeを試していないので、機能的な違いがあるかどうかはわかりません。
      minicondaをインストールする目的は、パッケージのインストールが容易ではなく、仮想環境を簡単に作成および管理することでした。

      次のようにしてみてください。
      – minicondaの代わりにvenvまたはvirtualenvを使用する(参照: https://richwind.co.kr/193)
      - 「2.5。必要なパッケージのインストール」の内容のうち「conda install」を「pip install」に変更

      よろしくお願いします。

      • アバター写真 서희경 より:

        いったんminiforgeをインストールしてMiniforge Promptで上記の手順を実行しましたが、何も起こりませんでした。
        そして私に知らせた「Microsoft Build Tools 2015 Update 3」はインストールがうまくいかなかったので、私はMicrosoft Build Tools 2022をインストールしてeunjeonを受け取りました。

        今、私は抽出ツールを試してみて、またフィードバックします🙂

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

ja日本語