AntonKueltz / fastecdsa

Python library for fast elliptic curve crypto
https://pypi.python.org/pypi/fastecdsa
The Unlicense
270 stars 78 forks source link

does not install with python3.9 #81

Closed hhp-the-maestro closed 2 years ago

hhp-the-maestro commented 2 years ago

I was struggling to install fastecdsa for a while , later i found the problem is that, it seems to install fine with python3.8 and does not install with python3.9.

AntonKueltz commented 2 years ago

Do you have logs the for the failure? The CI jobs for this test 3.6-3.10 and I’ve built locally against those versions many times.

hhp-the-maestro commented 2 years ago

Do you have logs the for the failure? The CI jobs for this test 3.6-3.10 and I’ve built locally against those versions many times.

`Collecting fastecdsa Using cached fastecdsa-2.2.3.tar.gz (48 kB) Building wheels for collected packages: fastecdsa Building wheel for fastecdsa (setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0slh45uj/fastecdsa/setup.py'"'"'; file='"'"'/tmp/pip-install-0slh45uj/fastecdsa/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-j1fpjmw7 cwd: /tmp/pip-install-0slh45uj/fastecdsa/ Complete output (50 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.9 creating build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/init.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/keys.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/ecdsa.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/benchmark.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/point.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/util.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/curve.py -> build/lib.linux-x86_64-3.9/fastecdsa creating build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/init.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_key_export_import.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_point.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_prime_field_curve_math.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_prehashed.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_nonce_generation.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_brainpool_ecdh.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_whycheproof_vectors.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_keygen.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_rfc6979_ecdsa.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_key_recovery.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_p256_ecdsa.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_whitespace_parsing.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests creating build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/init.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/pem.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/der.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/asn1.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/sec1.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/util.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding creating build/lib.linux-x86_64-3.9/fastecdsa/tests/encoding copying fastecdsa/tests/encoding/init.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests/encoding copying fastecdsa/tests/encoding/test_der.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests/encoding copying fastecdsa/tests/encoding/test_sec1.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests/encoding running build_ext building 'fastecdsa.curvemath' extension creating build/temp.linux-x86_64-3.9 creating build/temp.linux-x86_64-3.9/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 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc/ -I/usr/include/python3.9 -c src/curve.c -o build/temp.linux-x86_64-3.9/src/curve.o -O2 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 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc/ -I/usr/include/python3.9 -c src/curveMath.c -o build/temp.linux-x86_64-3.9/src/curveMath.o -O2 In file included from src/curveMath.c:1: src/curveMath.h:4:10: fatal error: Python.h: No such file or directory 4 | #include | ^~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

ERROR: Failed building wheel for fastecdsa Running setup.py clean for fastecdsa Failed to build fastecdsa Installing collected packages: fastecdsa Running setup.py install for fastecdsa ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0slh45uj/fastecdsa/setup.py'"'"'; file='"'"'/tmp/pip-install-0slh45uj/fastecdsa/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-xzkx3ufj/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/fastecdsa cwd: /tmp/pip-install-0slh45uj/fastecdsa/ Complete output (50 lines): running install running build running build_py creating build creating build/lib.linux-x86_64-3.9 creating build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/init.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/keys.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/ecdsa.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/benchmark.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/point.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/util.py -> build/lib.linux-x86_64-3.9/fastecdsa copying fastecdsa/curve.py -> build/lib.linux-x86_64-3.9/fastecdsa creating build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/init.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_key_export_import.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_point.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_prime_field_curve_math.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_prehashed.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_nonce_generation.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_brainpool_ecdh.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_whycheproof_vectors.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_keygen.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_rfc6979_ecdsa.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_key_recovery.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_p256_ecdsa.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests copying fastecdsa/tests/test_whitespace_parsing.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests creating build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/init.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/pem.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/der.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/asn1.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/sec1.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding copying fastecdsa/encoding/util.py -> build/lib.linux-x86_64-3.9/fastecdsa/encoding creating build/lib.linux-x86_64-3.9/fastecdsa/tests/encoding copying fastecdsa/tests/encoding/init.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests/encoding copying fastecdsa/tests/encoding/test_der.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests/encoding copying fastecdsa/tests/encoding/test_sec1.py -> build/lib.linux-x86_64-3.9/fastecdsa/tests/encoding running build_ext building 'fastecdsa.curvemath' extension creating build/temp.linux-x86_64-3.9 creating build/temp.linux-x86_64-3.9/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 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc/ -I/usr/include/python3.9 -c src/curve.c -o build/temp.linux-x86_64-3.9/src/curve.o -O2 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 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc/ -I/usr/include/python3.9 -c src/curveMath.c -o build/temp.linux-x86_64-3.9/src/curveMath.o -O2 In file included from src/curveMath.c:1: src/curveMath.h:4:10: fatal error: Python.h: No such file or directory 4 | #include | ^~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

ERROR: Command errored out with exit status 1: /usr/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0slh45uj/fastecdsa/setup.py'"'"'; file='"'"'/tmp/pip-install-0slh45uj/fastecdsa/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-xzkx3ufj/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/fastecdsa Check the logs for full command output. `

AntonKueltz commented 2 years ago

You need to install the python3.9 dev tools i.e. the headers so that you can compile the C extensions. This is beyond the scope of this project but there's plenty of resources online for how to install them on your given OS.

hhp-the-maestro commented 2 years ago

You need to install the python3.9 dev tools i.e. the headers so that you can compile the C extensions. This is beyond the scope of this project but there's plenty of resources online for how to install them on your given OS.

Buddy, I have tried out every solution on the internet it does not work. you can mail me @ hhp07022000@gmail.com

AntonKueltz commented 2 years ago

I highly doubt that. Just install python3.9-dev (or python3.9-devel on some distros) with your package manager. This is not a problem with this library, this is a an issue with your dev environment not being set up to compile C extensions for any python project when using python3.9.

It's literally the first result when you google the error message "fatal error: Python.h: No such file or directory".

eliotstock commented 1 year ago

python3.9-dev is not available for Ubuntu 23.04, AFAICT.