<p>The <code>bitcoinlib</code> package depends on <code>fastecdsa</code> which requires (the <code>gmp.h</code> from the) GNU Multiple Precision Arithmetic Library (GMP), so install that before installing <code>bitcoinlib</code> e.g.</p>
<pre class="lang-shell prettyprint-override"><code>sudo apt-get install libgmp-dev
</code></pre>

CC BY-SA 4.0
2023-01-13T20:53:40.903Z
2023-01-13T20:53:40.903Z
user139347
<p>I try install bitcoinlib python package and I get an error:</p>
<pre><code>Collecting bitcoinlib   Using cached bitcoinlib-0.6.5-py3-none-any.whl (315 kB) Requirement already satisfied: numpy&gt;=1.21.0 in ./venv/lib/python3.10/site-packages (from bitcoinlib) (1.23.1) Requirement already satisfied: requests&gt;=2.25.0 in ./venv/lib/python3.10/site-packages (from bitcoinlib) (2.28.1) Requirement already satisfied: SQLAlchemy&gt;=1.4.28 in ./venv/lib/python3.10/site-packages (from bitcoinlib) (1.4.39) Requirement already satisfied: pycryptodome&gt;=3.14.1 in ./venv/lib/python3.10/site-packages (from bitcoinlib) (3.15.0) Collecting fastecdsa&gt;=2.2.3   Using cached fastecdsa-2.2.3.tar.gz (48 kB)   Preparing metadata (setup.py) ... done Requirement already satisfied: urllib3&lt;1.27,&gt;=1.21.1 in ./venv/lib/python3.10/site-packages (from requests&gt;=2.25.0-&gt;bitcoinlib) (1.26.10) Requirement already satisfied: charset-normalizer&lt;3,&gt;=2 in ./venv/lib/python3.10/site-packages (from requests&gt;=2.25.0-&gt;bitcoinlib) (2.1.0) Requirement already satisfied: certifi&gt;=2017.4.17 in ./venv/lib/python3.10/site-packages (from requests&gt;=2.25.0-&gt;bitcoinlib) (2022.6.15) Requirement already satisfied: idna&lt;4,&gt;=2.5 in ./venv/lib/python3.10/site-packages (from requests&gt;=2.25.0-&gt;bitcoinlib) (3.3) Building wheels for collected packages: fastecdsa   Building wheel for fastecdsa (setup.py) ... error   ERROR: Command errored out with exit status 1:    command: /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/bin/python -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'&quot;'&quot;';
__file__='&quot;'&quot;'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'&quot;'&quot;';f
= getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__) if os.path.exists(__file__) else io.StringIO('&quot;'&quot;'from setuptools import setup; setup()'&quot;'&quot;');code = f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' bdist_wheel -d /private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-wheel-glm0yzzn
       cwd: /private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/ Complete output (49 lines):   running bdist_wheel   running build   running build_py   creating build   creating build/lib.macosx-10.9-universal2-cpython-310   creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/benchmark.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/util.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/__init__.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/keys.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/curve.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/point.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/ecdsa.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_point.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_keygen.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_nonce_generation.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_key_recovery.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_key_export_import.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_whycheproof_vectors.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/__init__.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_prehashed.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_brainpool_ecdh.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_rfc6979_ecdsa.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_whitespace_parsing.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_prime_field_curve_math.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_p256_ecdsa.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/pem.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/util.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/__init__.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/sec1.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/der.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/asn1.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding  copying fastecdsa/tests/encoding/test_sec1.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding  copying fastecdsa/tests/encoding/__init__.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding  copying fastecdsa/tests/encoding/test_der.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding  running build_ext   building 'fastecdsa.curvemath' extension   creating build/temp.macosx-10.9-universal2-cpython-310   creating build/temp.macosx-10.9-universal2-cpython-310/src   clang
-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -stdlib=libc++ -Isrc/ -I/Users/ofekbenharosh/PycharmProjects/pythonProject/venv/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10
-c src/curve.c -o build/temp.macosx-10.9-universal2-cpython-310/src/curve.o -O2   In file included from src/curve.c:1:   src/curve.h:4:10: fatal error: 'gmp.h' file not found   #include &quot;gmp.h&quot;
           ^~~~~~~   1 error generated.   error: command '/usr/bin/clang' 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, bitcoinlib
    Running setup.py install for fastecdsa ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/bin/python -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'&quot;'&quot;';
__file__='&quot;'&quot;'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'&quot;'&quot;';f
= getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__) if os.path.exists(__file__) else io.StringIO('&quot;'&quot;'from setuptools import setup; setup()'&quot;'&quot;');code = f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' install --record /private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-record-xuukb0iy/install-record.txt
--single-version-externally-managed --compile --install-headers /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/include/site/python3.10/fastecdsa
         cwd: /private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/
    Complete output (51 lines):
    running install
    /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-universal2-cpython-310
    creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/benchmark.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/util.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/__init__.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/keys.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/curve.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/point.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/ecdsa.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_point.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_keygen.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_nonce_generation.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_key_recovery.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_key_export_import.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_whycheproof_vectors.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/__init__.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_prehashed.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_brainpool_ecdh.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_rfc6979_ecdsa.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_whitespace_parsing.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_prime_field_curve_math.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_p256_ecdsa.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/pem.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/util.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/__init__.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/sec1.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/der.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/asn1.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding
    copying fastecdsa/tests/encoding/test_sec1.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding
    copying fastecdsa/tests/encoding/__init__.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding
    copying fastecdsa/tests/encoding/test_der.py -&gt; build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding
    running build_ext
    building 'fastecdsa.curvemath' extension
    creating build/temp.macosx-10.9-universal2-cpython-310
    creating build/temp.macosx-10.9-universal2-cpython-310/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -stdlib=libc++ -Isrc/
-I/Users/ofekbenharosh/PycharmProjects/pythonProject/venv/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10
-c src/curve.c -o build/temp.macosx-10.9-universal2-cpython-310/src/curve.o -O2
    In file included from src/curve.c:1:
    src/curve.h:4:10: fatal error: 'gmp.h' file not found
    #include &quot;gmp.h&quot;
             ^~~~~~~
    1 error generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ---------------------------------------- ERROR: Command errored out with exit status 1: /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/bin/python -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'&quot;'&quot;';
__file__='&quot;'&quot;'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'&quot;'&quot;';f
= getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__) if os.path.exists(__file__) else io.StringIO('&quot;'&quot;'from setuptools import setup; setup()'&quot;'&quot;');code = f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' install --record /private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-record-xuukb0iy/install-record.txt
--single-version-externally-managed --compile --install-headers /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/include/site/python3.10/fastecdsa Check the logs for full command output.
</code></pre>

<bitcoin-core><transactions><bitcoin-core-development><python>
Python unable to install Bitcoinlib
Salvador
# Python unable to install Bitcoinlib

(Asked by: username_0 on 2022-07-24)

I try install bitcoinlib python package and I get an error:
Collecting bitcoinlib   Using cached bitcoinlib-0.6.5-py3-none-any.whl (315 kB) Requirement already satisfied: numpy>=1.21.0 in ./venv/lib/python3.10/site-packages (from bitcoinlib) (1.23.1) Requirement already satisfied: requests>=2.25.0 in ./venv/lib/python3.10/site-packages (from bitcoinlib) (2.28.1) Requirement already satisfied: SQLAlchemy>=1.4.28 in ./venv/lib/python3.10/site-packages (from bitcoinlib) (1.4.39) Requirement already satisfied: pycryptodome>=3.14.1 in ./venv/lib/python3.10/site-packages (from bitcoinlib) (3.15.0) Collecting fastecdsa>=2.2.3   Using cached fastecdsa-2.2.3.tar.gz (48 kB)   Preparing metadata (setup.py) ... done Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./venv/lib/python3.10/site-packages (from requests>=2.25.0->bitcoinlib) (1.26.10) Requirement already satisfied: charset-normalizer<3,>=2 in ./venv/lib/python3.10/site-packages (from requests>=2.25.0->bitcoinlib) (2.1.0) Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.10/site-packages (from requests>=2.25.0->bitcoinlib) (2022.6.15) Requirement already satisfied: idna<4,>=2.5 in ./venv/lib/python3.10/site-packages (from requests>=2.25.0->bitcoinlib) (3.3) Building wheels for collected packages: fastecdsa   Building wheel for fastecdsa (setup.py) ... error   ERROR: Command errored out with exit status 1:    command: /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/bin/python -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'"'"';
__file__='"'"'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-wheel-glm0yzzn
       cwd: /private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/ Complete output (49 lines):   running bdist_wheel   running build   running build_py   creating build   creating build/lib.macosx-10.9-universal2-cpython-310   creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/benchmark.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/util.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/keys.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/curve.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/point.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   copying fastecdsa/ecdsa.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa   creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_point.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_keygen.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_nonce_generation.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_key_recovery.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_key_export_import.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_whycheproof_vectors.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_prehashed.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_brainpool_ecdh.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_rfc6979_ecdsa.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_whitespace_parsing.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_prime_field_curve_math.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   copying fastecdsa/tests/test_p256_ecdsa.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests   creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/pem.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/util.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/sec1.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/der.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   copying fastecdsa/encoding/asn1.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding   creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding  copying fastecdsa/tests/encoding/test_sec1.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding  copying fastecdsa/tests/encoding/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding  copying fastecdsa/tests/encoding/test_der.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding  running build_ext   building 'fastecdsa.curvemath' extension   creating build/temp.macosx-10.9-universal2-cpython-310   creating build/temp.macosx-10.9-universal2-cpython-310/src   clang
-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -stdlib=libc++ -Isrc/ -I/Users/ofekbenharosh/PycharmProjects/pythonProject/venv/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10
-c src/curve.c -o build/temp.macosx-10.9-universal2-cpython-310/src/curve.o -O2   In file included from src/curve.c:1:   src/curve.h:4:10: fatal error: 'gmp.h' file not found   #include "gmp.h"
           ^~~~~~~   1 error generated.   error: command '/usr/bin/clang' 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, bitcoinlib
    Running setup.py install for fastecdsa ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/bin/python -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'"'"';
__file__='"'"'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-record-xuukb0iy/install-record.txt
--single-version-externally-managed --compile --install-headers /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/include/site/python3.10/fastecdsa
         cwd: /private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/
    Complete output (51 lines):
    running install
    /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-universal2-cpython-310
    creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/benchmark.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/util.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/keys.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/curve.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/point.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    copying fastecdsa/ecdsa.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa
    creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_point.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_keygen.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_nonce_generation.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_key_recovery.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_key_export_import.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_whycheproof_vectors.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_prehashed.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_brainpool_ecdh.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_rfc6979_ecdsa.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_whitespace_parsing.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_prime_field_curve_math.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    copying fastecdsa/tests/test_p256_ecdsa.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests
    creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/pem.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/util.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/sec1.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/der.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    copying fastecdsa/encoding/asn1.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/encoding
    creating build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding
    copying fastecdsa/tests/encoding/test_sec1.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding
    copying fastecdsa/tests/encoding/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding
    copying fastecdsa/tests/encoding/test_der.py -> build/lib.macosx-10.9-universal2-cpython-310/fastecdsa/tests/encoding
    running build_ext
    building 'fastecdsa.curvemath' extension
    creating build/temp.macosx-10.9-universal2-cpython-310
    creating build/temp.macosx-10.9-universal2-cpython-310/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -stdlib=libc++ -Isrc/
-I/Users/ofekbenharosh/PycharmProjects/pythonProject/venv/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10
-c src/curve.c -o build/temp.macosx-10.9-universal2-cpython-310/src/curve.o -O2
    In file included from src/curve.c:1:
    src/curve.h:4:10: fatal error: 'gmp.h' file not found
    #include "gmp.h"
             ^~~~~~~
    1 error generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ---------------------------------------- ERROR: Command errored out with exit status 1: /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/bin/python -u
-c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'"'"';
__file__='"'"'/private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-install-nf5yyqfc/fastecdsa_7d7c1187bcda423cbb18e2513ee27e01/setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/1s/0c6cnvt947n5r6_07k__th6r0000gn/T/pip-record-xuukb0iy/install-record.txt
--single-version-externally-managed --compile --install-headers /Users/ofekbenharosh/PycharmProjects/pythonProject/venv/include/site/python3.10/fastecdsa Check the logs for full command output.

**Tags:** bitcoin-core, transactions, bitcoin-core-development, python


---

## 1 answers

### Answer by username_1 on 2023-01-13. Score: 1

The bitcoinlib package depends on fastecdsa which requires (the gmp.h from the) GNU Multiple Precision Arithmetic Library (GMP), so install that before installing bitcoinlib e.g.
sudo apt-get install libgmp-dev


---

