題名の通りです。
OSはCentOS7を使用しています。
以下に経緯を書きます。
python3.6をインストール後、ある.pyファイルを実行しようとすると
ModuleNotFoundError: No module named 'regex'
というメッセージが表示されました。
ネットで調べ、regexをインストールするにはpipというパッケージ管理システムを使うようだと思いpipをインストールしました。そして
pip install regex
とコマンドを入力すると
Collecting regex
Using cached https://files.pythonhosted.org/packages/2a/0a/944977367c8a6cfcfa6fcb8ac6b1f0f9a667c1f34194091c766b5d7c44d7/regex-2018.08.29.tar.gz
Building wheels for collected packages: regex
Running setup.py bdist_wheel for regex ... error
Complete output from command /bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-0tywgvpe/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-8n1xbj2t --python-tag cp36:
/usr/lib/python3.6/site-packages/setuptools/dist.py:397: UserWarning: Normalizing '2018.08.29' to '2018.8.29'
normalized_version,
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying regex_3/regex.py -> build/lib.linux-x86_64-3.6
copying regex_3/_regex_core.py -> build/lib.linux-x86_64-3.6
copying regex_3/test_regex.py -> build/lib.linux-x86_64-3.6
running build_ext
building '_regex' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/regex_3
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c regex_3/_regex.c -o build/temp.linux-x86_64-3.6/regex_3/_regex.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
Failed building wheel for regex
Running setup.py clean for regex
Failed to build regex
Installing collected packages: regex
Running setup.py install for regex ... error
Complete output from command /bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-0tywgvpe/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-h8ah7c_k/install-record.txt --single-version-externally-managed --compile:
/usr/lib/python3.6/site-packages/setuptools/dist.py:397: UserWarning: Normalizing '2018.08.29' to '2018.8.29'
normalized_version,
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying regex_3/regex.py -> build/lib.linux-x86_64-3.6
copying regex_3/_regex_core.py -> build/lib.linux-x86_64-3.6
copying regex_3/test_regex.py -> build/lib.linux-x86_64-3.6
running build_ext
building '_regex' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/regex_3
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c regex_3/_regex.c -o build/temp.linux-x86_64-3.6/regex_3/_regex.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-0tywgvpe/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-h8ah7c_k/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-0tywgvpe/regex/
とエラーメッセージ?が表示されてインストールできません。
なにが原因で、どのようにすればインストールができるようになるかご教示ください。
よろしくお願いいたします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/27 15:18
2018/09/28 05:44