前提・実現したいこと
pip2でのnltkインストール中に以下のエラーが発生し、インストールに失敗しました。
発生している問題・エラーメッセージ
Processing /root/.cache/pip/wheels/c7/b1/76/54236c34227a12d32dc9cfe18731976baf8950d8a5aabaea6c/nltk-3.5-py2-none-any.whl Requirement already satisfied: click in /usr/local/lib/python2.7/dist-packages (from nltk) (7.1.2) Requirement already satisfied: tqdm in /usr/local/lib/python2.7/dist-packages (from nltk) (4.54.1) Requirement already satisfied: joblib in /usr/local/lib/python2.7/dist-packages (from nltk) (0.14.1) Collecting regex Using cached regex-2020.11.13.tar.gz (694 kB) Building wheels for collected packages: regex Building wheel for regex (setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-S2hLKa/regex/setup.py'"'"'; __file__='"'"'/tmp/pip-install-S2hLKa/regex/setup.py'"'"'; f=getattr(tokenize, '"'"'open'"'"', open)(__file__); code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"'); f.close(); exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-2P6E6l cwd: /tmp/pip-install-S2hLKa/regex/ Complete output (20 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/regex copying regex_2/__init__.py -> build/lib.linux-x86_64-2.7/regex copying regex_2/regex.py -> build/lib.linux-x86_64-2.7/regex copying regex_2/_regex_core.py -> build/lib.linux-x86_64-2.7/regex copying regex_2/test_regex.py -> build/lib.linux-x86_64-2.7/regex running build_ext building 'regex._regex' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/regex_2 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-uC7NI8/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c regex_2/_regex.c -o build/temp.linux-x86_64-2.7/regex_2/_regex.o regex_2/_regex.c:50:10: fatal error: Python.h: そのようなファイルやディ レクトリはありません 50 | #include "Python.h" | ^~~~~~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- ERROR: Failed building wheel for regex Running setup.py clean for regex Failed to build regex Installing collected packages: regex, nltk Running setup.py install for regex ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-S2hLKa/regex/setup.py'"'"'; __file__='"'"'/tmp/pip-install-S2hLKa/regex/setup.py'"'"'; f=getattr(tokenize, '"'"'open'"'"', open)(__file__); code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"'); f.close(); exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-Z_CIMI/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python2.7/regex cwd: /tmp/pip-install-S2hLKa/regex/ Complete output (20 lines): running install running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/regex copying regex_2/__init__.py -> build/lib.linux-x86_64-2.7/regex copying regex_2/regex.py -> build/lib.linux-x86_64-2.7/regex copying regex_2/_regex_core.py -> build/lib.linux-x86_64-2.7/regex copying regex_2/test_regex.py -> build/lib.linux-x86_64-2.7/regex running build_ext building 'regex._regex' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/regex_2 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-uC7NI8/python2.7-2.7.18=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c regex_2/_regex.c -o build/temp.linux-x86_64-2.7/regex_2/_regex.o regex_2/_regex.c:50:10: fatal error: Python.h: そのようなファイルやデ ィレクトリはありません 50 | #include "Python.h" | ^~~~~~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-S2hLKa/regex/setup.py'"'"'; __file__='"'"'/tmp/pip-install-S2hLKa/regex/setup.py'"'"'; f=getattr(tokenize, '"'"'open'"'"', open)(__file__); code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"'); f.close(); exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-Z_CIMI/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python2.7/regex Check the logs for full command output.
試したこと
nltk pip2 failed などで検索しましたが、解決できそうな情報が得られず困っています。
どなたかご教授お願いいたします。
補足情報(FW/ツールのバージョンなど)
Kali Linux 2020.2
Python 2.7.18
pip2 20.3.3
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/12/16 23:02