pip install pycosat
を実行しますが、次のようになります:
Downloading/unpacking pycosat
Downloading pycosat-0.6.1.tar.gz (59kB): 59kB downloaded
Running setup.py (path:/tmp/pip_build_masi/pycosat/setup.py) Egg_info for package pycosat
Installing collected packages: pycosat
Running setup.py install for pycosat
building 'pycosat' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPYCOSAT_VERSION="0.6.1" -I/usr/include/python2.7 -c pycosat.c -o build/temp.linux-x86_64-2.7/pycosat.o
pycosat.c:9:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_masi/pycosat/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-40CYkM-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying test_pycosat.py -> build/lib.linux-x86_64-2.7
running build_ext
building 'pycosat' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPYCOSAT_VERSION="0.6.1" -I/usr/include/python2.7 -c pycosat.c -o build/temp.linux-x86_64-2.7/pycosat.o
pycosat.c:9:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_masi/pycosat/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-40CYkM-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_masi/pycosat
Storing debug log for failure in /home/masi/.pip/pip.log
Sudo -H pip install pycosat
を実行しますが、次のようになります:
Collecting pycosat
Using cached pycosat-0.6.1.tar.gz
Building wheels for collected packages: pycosat
Running setup.py bdist_wheel for pycosat ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-0CcATa/pycosat/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpa1EG1Fpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying test_pycosat.py -> build/lib.linux-x86_64-2.7
running build_ext
building 'pycosat' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPYCOSAT_VERSION="0.6.1" -I/usr/include/python2.7 -c pycosat.c -o build/temp.linux-x86_64-2.7/pycosat.o
pycosat.c:9:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pycosat
Running setup.py clean for pycosat
Failed to build pycosat
Installing collected packages: pycosat
Running setup.py install for pycosat ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-0CcATa/pycosat/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-l6ZMSb-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying test_pycosat.py -> build/lib.linux-x86_64-2.7
running build_ext
building 'pycosat' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPYCOSAT_VERSION="0.6.1" -I/usr/include/python2.7 -c pycosat.c -o build/temp.linux-x86_64-2.7/pycosat.o
pycosat.c:9:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-0CcATa/pycosat/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-l6ZMSb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-0CcATa/pycosat/
Sudo
をpip
と一緒に使用するのは好きではありません。しかし、おそらくここで必要です。コンパイル時にgcc
エラーが発生する理由がわかりません。
UbuntuにPycosatをインストールするにはどうすればよいですか?
https://stackoverflow.com/a/32030746/486919 から、Sudo apt-get install python-dev
を実行する前にpip install pycosat
を実行します。