When I run pip install -r requirements.txt
on EC2 / Amazon Linux2, the following 30 lines of error text are output and the installation fails.
ERROR: Command errored out with exit status 1:
command: /home/my-user/.venvs/my_app/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ok4gp9ve/scikit-surprise/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ok4gp9ve/scikit-surprise/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-d52oris6/install-record.txt --single-version-externally-managed --compile --install-headers /home/my-user/.venvs/my_app/include/site/python3.7/scikit-surprise
cwd: /tmp/pip-install-ok4gp9ve/scikit-surprise/
Complete output (53 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/surprise
...(Abbreviation)...
creating build/temp.linux-x86_64-3.7/surprise
gcc -pthread -Wno-unused-result -Wsign-compare -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/home/my-user/.venvs/my_app/lib64/python3.7/site-packages/numpy/core/include -I/home/my-user/.venvs/my_app/include -I/usr/include/python3.7m -c surprise/similarities.c -o build/temp.linux-x86_64-3.7/surprise/similarities.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/my-user/.venvs/my_app/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ok4gp9ve/scikit-surprise/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ok4gp9ve/scikit-surprise/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-d52oris6/install-record.txt --single-version-externally-managed --compile --install-headers /home/my-user/.venvs/my_app/include/site/python3.7/scikit-surprise Check the logs for full command output.
If you read the error at the bottom, it says ERROR: Command errored out with exit status 1: ~
. I found ../scikit-surprise/..
when I scanned it. This is a Python package.
This error statement indicates that the installation of scikit-surprise
has failed.
Just above the above error statement,
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
Is written. I googled this error statement and found an article introducing the solution.
It seems that it was improved by installing gcc
with the following command.
$ sudo yum install gcc
Execute the command immediately and install again with pip. Result is,
Fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
Compiling has stopped.
error: command 'gcc' failed with exit status 1
Another error occurred with Python.h: No such file or directory
. Without improvement,
When I googled with scikit-surprise
and the error sentence while thinking seriously, almost the same error occurred in GitHub issue There was a person who was terrifying.
There is a stack overflow article in the conversation, and the article says Python. The h: No such file or directory
error seems to be caused by the library Python dev
not being properly installed.
Therefore, it should be improved by executing the following command and installing Python devel
.
$ sudo yum install python3-devel
If you run it immediately and install pip,
Installing collected packages: scikit-surprise
Running setup.py install for scikit-surprise ... done
Successfully installed scikit-surprise-1.1.1
Is displayed and the installation was successful. I did it! !! !! !!
I don't know if it will be useful, but I did a lot of research so I wrote an article. I would be grateful if you could point out any mistakes!
-I got an error when installing Ansible with pip
Recommended Posts