CAIDA / bgpstream

BGP measurement analysis for the masses
GNU General Public License v2.0
109 stars 43 forks source link

Problem Installing pybgpstream #117

Open paulmac57 opened 3 years ago

paulmac57 commented 3 years ago

I see that this same issue was closed in 2016 but I am getting the same problem when running pip3 install pybgpstream

compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-qpmce5u3/pybgpstream/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-yx4d00ht-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-qpmce5u3/pybgpstream/

However everything works ok in 2.7, is this fixed yet for python3 ?

alistairking commented 3 years ago

Can you give some more details? What OS is this? PyBGPStream definitely works under Python3 (at least it has when I've tried it :)

paulmac57 commented 3 years ago

Hi Alistair thanks for getting back to me, its Linux 5.3.0-53-generic #47~18.04.1-Ubuntu

here is the full error

pip3 install pybgpstream Collecting pybgpstream Using cached https://files.pythonhosted.org/packages/41/84/fbd89db421702b11da3a29b8ed899b26c660da4d1e041e0f05267bbf270b/pybgpstream-2.0.2.tar.gz Collecting python-dateutil (from pybgpstream) Using cached https://files.pythonhosted.org/packages/36/7a/87837f39d0296e723bb9b62bbb257d0355c7f6128853c78955f57342a56d/python_dateutil-2.8.2-py2.py3-none-any.whl Collecting six>=1.5 (from python-dateutil->pybgpstream) Using cached https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl Building wheels for collected packages: pybgpstream Running setup.py bdist_wheel for pybgpstream ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-8vxl_pap/pybgpstream/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/tmpx0bzjn9opip-wheel- --python-tag cp37: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.7 creating build/lib.linux-x86_64-3.7/pybgpstream copying pybgpstream/init.py -> build/lib.linux-x86_64-3.7/pybgpstream copying pybgpstream/pybgpstream.py -> build/lib.linux-x86_64-3.7/pybgpstream copying pybgpstream/test_pybgpstream.py -> build/lib.linux-x86_64-3.7/pybgpstream running build_ext building '_pybgpstream' extension creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/src x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/_pybgpstream_version.c -o build/temp.linux-x86_64-3.7/src/_pybgpstream_version.o x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/_pybgpstream_module.c -o build/temp.linux-x86_64-3.7/src/_pybgpstream_module.o In file included from src/_pybgpstream_module.c:27:0: src/_pybgpstream_bgpelem.h:31:10: fatal error: Python.h: No such file or directory

include

        ^~~~~~~~~~

compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1


Failed building wheel for pybgpstream Running setup.py clean for pybgpstream Failed to build pybgpstream Installing collected packages: six, python-dateutil, pybgpstream Running setup.py install for pybgpstream ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-8vxl_pap/pybgpstream/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-umgsjaha-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: 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/pybgpstream copying pybgpstream/init.py -> build/lib.linux-x86_64-3.7/pybgpstream copying pybgpstream/pybgpstream.py -> build/lib.linux-x86_64-3.7/pybgpstream copying pybgpstream/test_pybgpstream.py -> build/lib.linux-x86_64-3.7/pybgpstream running build_ext building '_pybgpstream' extension creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/src x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/_pybgpstream_version.c -o build/temp.linux-x86_64-3.7/src/_pybgpstream_version.o x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/_pybgpstream_module.c -o build/temp.linux-x86_64-3.7/src/_pybgpstream_module.o In file included from src/_pybgpstream_module.c:27:0: src/_pybgpstream_bgpelem.h:31:10: fatal error: Python.h: No such file or directory

include

          ^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-8vxl_pap/pybgpstream/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-umgsjaha-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-8vxl_pap/pybgpstream/

jiaoqiyuan commented 3 years ago

Hi Alistair thanks for getting back to me, its Linux 5.3.0-53-generic #47~18.04.1-Ubuntu

here is the full error

pip3 install pybgpstream Collecting pybgpstream Using cached https://files.pythonhosted.org/packages/41/84/fbd89db421702b11da3a29b8ed899b26c660da4d1e041e0f05267bbf270b/pybgpstream-2.0.2.tar.gz Collecting python-dateutil (from pybgpstream) Using cached https://files.pythonhosted.org/packages/36/7a/87837f39d0296e723bb9b62bbb257d0355c7f6128853c78955f57342a56d/python_dateutil-2.8.2-py2.py3-none-any.whl Collecting six>=1.5 (from python-dateutil->pybgpstream) Using cached https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl Building wheels for collected packages: pybgpstream Running setup.py bdist_wheel for pybgpstream ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-8vxl_pap/pybgpstream/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/tmpx0bzjn9opip-wheel- --python-tag cp37: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.7 creating build/lib.linux-x86_64-3.7/pybgpstream copying pybgpstream/init.py -> build/lib.linux-x86_64-3.7/pybgpstream copying pybgpstream/pybgpstream.py -> build/lib.linux-x86_64-3.7/pybgpstream copying pybgpstream/test_pybgpstream.py -> build/lib.linux-x86_64-3.7/pybgpstream running build_ext building '_pybgpstream' extension creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/src x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/_pybgpstream_version.c -o build/temp.linux-x86_64-3.7/src/_pybgpstream_version.o x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/_pybgpstream_module.c -o build/temp.linux-x86_64-3.7/src/_pybgpstream_module.o In file included from src/_pybgpstream_module.c:27:0: src/_pybgpstream_bgpelem.h:31:10: fatal error: Python.h: No such file or directory #include ^~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Failed building wheel for pybgpstream Running setup.py clean for pybgpstream Failed to build pybgpstream Installing collected packages: six, python-dateutil, pybgpstream Running setup.py install for pybgpstream ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-8vxl_pap/pybgpstream/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-umgsjaha-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: 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/pybgpstream copying pybgpstream/init.py -> build/lib.linux-x86_64-3.7/pybgpstream copying pybgpstream/pybgpstream.py -> build/lib.linux-x86_64-3.7/pybgpstream copying pybgpstream/test_pybgpstream.py -> build/lib.linux-x86_64-3.7/pybgpstream running build_ext building '_pybgpstream' extension creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/src x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/_pybgpstream_version.c -o build/temp.linux-x86_64-3.7/src/_pybgpstream_version.o x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/_pybgpstream_module.c -o build/temp.linux-x86_64-3.7/src/_pybgpstream_module.o In file included from src/_pybgpstream_module.c:27:0: src/_pybgpstream_bgpelem.h:31:10: fatal error: Python.h: No such file or directory #include ^~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-8vxl_pap/pybgpstream/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-umgsjaha-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-8vxl_pap/pybgpstream/

May be you should install python dev lib, run this cmd on ubuntu:

sudo apt install python3-dev