AntonKueltz / fastecdsa

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

installation error on shared hosting #80

Closed jonathonthedmi closed 2 years ago

jonathonthedmi commented 2 years ago
Collecting fastecdsa
  Using cached https://files.pythonhosted.org/packages/54/42/d2a3cf54abc381a14e6f9f2b60217111f2fabe7a71b31094ce9392c9b5e2/fastecdsa-2.2.3.tar.gz
Building wheels for collected packages: fastecdsa
  Running setup.py bdist_wheel for fastecdsa ... error
  Complete output from command /home/windows1/virtualenv/crypto/3.7/bin/python3.7_bin -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8y765tq3/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/tmpp5z7g797pip-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/fastecdsa
  copying fastecdsa/__init__.py -> build/lib.linux-x86_64-3.7/fastecdsa
  copying fastecdsa/benchmark.py -> build/lib.linux-x86_64-3.7/fastecdsa
  copying fastecdsa/curve.py -> build/lib.linux-x86_64-3.7/fastecdsa
  copying fastecdsa/ecdsa.py -> build/lib.linux-x86_64-3.7/fastecdsa
  copying fastecdsa/keys.py -> build/lib.linux-x86_64-3.7/fastecdsa
  copying fastecdsa/point.py -> build/lib.linux-x86_64-3.7/fastecdsa
  copying fastecdsa/util.py -> build/lib.linux-x86_64-3.7/fastecdsa
  creating build/lib.linux-x86_64-3.7/fastecdsa/encoding
  copying fastecdsa/encoding/__init__.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
  copying fastecdsa/encoding/asn1.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
  copying fastecdsa/encoding/der.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
  copying fastecdsa/encoding/pem.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
  copying fastecdsa/encoding/sec1.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
  copying fastecdsa/encoding/util.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
  creating build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/__init__.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_brainpool_ecdh.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_key_export_import.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_key_recovery.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_keygen.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_nonce_generation.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_p256_ecdsa.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_point.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_prehashed.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_prime_field_curve_math.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_rfc6979_ecdsa.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_whitespace_parsing.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  copying fastecdsa/tests/test_whycheproof_vectors.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
  creating build/lib.linux-x86_64-3.7/fastecdsa/tests/encoding
  copying fastecdsa/tests/encoding/__init__.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests/encoding
  copying fastecdsa/tests/encoding/test_der.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests/encoding
  copying fastecdsa/tests/encoding/test_sec1.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests/encoding
  running build_ext
  building 'fastecdsa.curvemath' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/src
  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 -Isrc/ -I/opt/alt/python37/include/python3.7m -c src/curveMath.c -o build/temp.linux-x86_64-3.7/src/curveMath.o -O2
  In file included from src/curveMath.c:1:0:
  src/curveMath.h:6:17: fatal error: gmp.h: No such file or directory
   #include <gmp.h>
                   ^
  compilation terminated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  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
    Complete output from command /home/windows1/virtualenv/crypto/3.7/bin/python3.7_bin -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8y765tq3/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-m2q38l8y-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/windows1/virtualenv/crypto/3.7/include/site/python3.7/fastecdsa:
    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/fastecdsa
    copying fastecdsa/__init__.py -> build/lib.linux-x86_64-3.7/fastecdsa
    copying fastecdsa/benchmark.py -> build/lib.linux-x86_64-3.7/fastecdsa
    copying fastecdsa/curve.py -> build/lib.linux-x86_64-3.7/fastecdsa
    copying fastecdsa/ecdsa.py -> build/lib.linux-x86_64-3.7/fastecdsa
    copying fastecdsa/keys.py -> build/lib.linux-x86_64-3.7/fastecdsa
    copying fastecdsa/point.py -> build/lib.linux-x86_64-3.7/fastecdsa
    copying fastecdsa/util.py -> build/lib.linux-x86_64-3.7/fastecdsa
    creating build/lib.linux-x86_64-3.7/fastecdsa/encoding
    copying fastecdsa/encoding/__init__.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
    copying fastecdsa/encoding/asn1.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
    copying fastecdsa/encoding/der.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
    copying fastecdsa/encoding/pem.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
    copying fastecdsa/encoding/sec1.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
    copying fastecdsa/encoding/util.py -> build/lib.linux-x86_64-3.7/fastecdsa/encoding
    creating build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/__init__.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_brainpool_ecdh.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_key_export_import.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_key_recovery.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_keygen.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_nonce_generation.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_p256_ecdsa.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_point.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_prehashed.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_prime_field_curve_math.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_rfc6979_ecdsa.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_whitespace_parsing.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    copying fastecdsa/tests/test_whycheproof_vectors.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests
    creating build/lib.linux-x86_64-3.7/fastecdsa/tests/encoding
    copying fastecdsa/tests/encoding/__init__.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests/encoding
    copying fastecdsa/tests/encoding/test_der.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests/encoding
    copying fastecdsa/tests/encoding/test_sec1.py -> build/lib.linux-x86_64-3.7/fastecdsa/tests/encoding
    running build_ext
    building 'fastecdsa.curvemath' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    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 -Isrc/ -I/opt/alt/python37/include/python3.7m -c src/curveMath.c -o build/temp.linux-x86_64-3.7/src/curveMath.o -O2
    In file included from src/curveMath.c:1:0:
    src/curveMath.h:6:17: fatal error: gmp.h: No such file or directory
     #include <gmp.h>
                     ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/windows1/virtualenv/crypto/3.7/bin/python3.7_bin -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8y765tq3/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-m2q38l8y-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/windows1/virtualenv/crypto/3.7/include/site/python3.7/fastecdsa" failed with error code 1 in /tmp/pip-build-8y765tq3/fastecdsa/

hey so what can be done if the user has no root privileges to install the gmp dependencies with yum? problem is package manager cannot be used to install dependency needed .

AntonKueltz commented 2 years ago

You could download and build GMP from source, though you may run into issues building it if you don't have sudo privileges. You'll probably have more luck asking the GMP community, this package presupposes a GMP install, and I'm not an expert on the different ways you can get GMP on your system without being root.