Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cairo-lang installation error on macos m1 chips #128

Closed
thisissamridh opened this issue Nov 30, 2022 · 1 comment
Closed

cairo-lang installation error on macos m1 chips #128

thisissamridh opened this issue Nov 30, 2022 · 1 comment

Comments

@thisissamridh
Copy link

$ pip install cairo-lang

output:-

Collecting cairo-lang
Using cached cairo-lang-0.10.2.zip (1.1 MB)
Preparing metadata (setup.py) ... done
Collecting aiohttp
Using cached aiohttp-3.8.3-cp39-cp39-macosx_11_0_arm64.whl (337 kB)
Collecting cachetools
Using cached cachetools-5.2.0-py3-none-any.whl (9.3 kB)
Collecting ecdsa
Using cached ecdsa-0.18.0-py2.py3-none-any.whl (142 kB)
Collecting eth-hash[pycryptodome]
Using cached eth_hash-0.5.1-py3-none-any.whl (9.0 kB)
Collecting fastecdsa
Using cached fastecdsa-2.2.3.tar.gz (48 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: frozendict==1.2 in ./cairo_venv/lib/python3.9/site-packages (from cairo-lang) (1.2)
Requirement already satisfied: lark in ./cairo_venv/lib/python3.9/site-packages (from cairo-lang) (1.1.4)
Collecting marshmallow-dataclass>=7.1.0
Using cached marshmallow_dataclass-8.5.10-py3-none-any.whl (17 kB)
Collecting marshmallow-enum
Using cached marshmallow_enum-1.5.1-py2.py3-none-any.whl (4.2 kB)
Collecting marshmallow-oneofschema
Using cached marshmallow_oneofschema-3.0.1-py2.py3-none-any.whl (5.8 kB)
Collecting marshmallow>=3.2.1
Using cached marshmallow-3.19.0-py3-none-any.whl (49 kB)
Requirement already satisfied: mpmath in ./cairo_venv/lib/python3.9/site-packages (from cairo-lang) (1.2.1)
Collecting numpy
Using cached numpy-1.23.5-cp39-cp39-macosx_11_0_arm64.whl (13.4 MB)
Collecting pipdeptree
Using cached pipdeptree-2.3.3-py3-none-any.whl (16 kB)
Collecting prometheus-client
Using cached prometheus_client-0.15.0-py3-none-any.whl (60 kB)
Collecting pytest
Using cached pytest-7.2.0-py3-none-any.whl (316 kB)
Collecting pytest-asyncio
Using cached pytest_asyncio-0.20.2-py3-none-any.whl (14 kB)
Collecting PyYAML
Using cached PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl (173 kB)
Collecting sympy
Using cached sympy-1.11.1-py3-none-any.whl (6.5 MB)
Collecting typeguard
Using cached typeguard-2.13.3-py3-none-any.whl (17 kB)
Collecting Web3
Using cached web3-5.31.1-py3-none-any.whl (501 kB)
Collecting packaging>=17.0
Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting typing-inspect>=0.7.1
Using cached typing_inspect-0.8.0-py3-none-any.whl (8.7 kB)
Collecting attrs>=17.3.0
Using cached attrs-22.1.0-py2.py3-none-any.whl (58 kB)
Collecting frozenlist>=1.1.1
Using cached frozenlist-1.3.3-cp39-cp39-macosx_11_0_arm64.whl (35 kB)
Collecting multidict<7.0,>=4.5
Using cached multidict-6.0.2-cp39-cp39-macosx_11_0_arm64.whl (29 kB)
Collecting async-timeout<5.0,>=4.0.0a3
Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting charset-normalizer<3.0,>=2.0
Using cached charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting yarl<2.0,>=1.0
Using cached yarl-1.8.1-cp39-cp39-macosx_11_0_arm64.whl (57 kB)
Collecting aiosignal>=1.1.2
Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting six>=1.9.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pycryptodome<4,>=3.6.6
Using cached pycryptodome-3.16.0.tar.gz (4.5 MB)
Preparing metadata (setup.py) ... done
Collecting tomli>=1.0.0
Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting pluggy<2.0,>=0.12
Using cached pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
Collecting exceptiongroup>=1.0.0rc8
Using cached exceptiongroup-1.0.4-py3-none-any.whl (14 kB)
Requirement already satisfied: iniconfig in ./cairo_venv/lib/python3.9/site-packages (from pytest->cairo-lang) (1.1.1)
Collecting jsonschema<5,>=3.2.0
Using cached jsonschema-4.17.3-py3-none-any.whl (90 kB)
Collecting eth-abi<3.0.0,>=2.0.0b6
Using cached eth_abi-2.2.0-py3-none-any.whl (28 kB)
Collecting ipfshttpclient==0.8.0a2
Using cached ipfshttpclient-0.8.0a2-py3-none-any.whl (82 kB)
Collecting eth-account<0.6.0,>=0.5.9
Using cached eth_account-0.5.9-py3-none-any.whl (101 kB)
Collecting requests<3.0.0,>=2.16.0
Using cached requests-2.28.1-py3-none-any.whl (62 kB)
Collecting websockets<10,>=9.1
Using cached websockets-9.1.tar.gz (76 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: lru-dict<2.0.0,>=1.1.6 in ./cairo_venv/lib/python3.9/site-packages (from Web3->cairo-lang) (1.1.8)
Collecting eth-typing<3.0.0,>=2.0.0
Using cached eth_typing-2.3.0-py3-none-any.whl (6.2 kB)
Collecting eth-rlp<0.3
Using cached eth_rlp-0.2.1-py3-none-any.whl (5.0 kB)
Collecting eth-utils<2.0.0,>=1.9.5
Using cached eth_utils-1.10.0-py3-none-any.whl (24 kB)
Collecting protobuf==3.19.5
Using cached protobuf-3.19.5-py2.py3-none-any.whl (162 kB)
Collecting hexbytes<1.0.0,>=0.1.0
Using cached hexbytes-0.3.0-py3-none-any.whl (6.4 kB)
Collecting multiaddr>=0.0.7
Using cached multiaddr-0.0.9-py2.py3-none-any.whl (16 kB)
Collecting parsimonious<0.9.0,>=0.8.0
Using cached parsimonious-0.8.1.tar.gz (45 kB)
Preparing metadata (setup.py) ... done
Collecting rlp<3,>=1.0.0
Using cached rlp-2.0.1-py2.py3-none-any.whl (20 kB)
Collecting bitarray<3,>=1.2.1
Using cached bitarray-2.6.0-cp39-cp39-macosx_11_0_arm64.whl (104 kB)
Collecting eth-keys<0.4.0,>=0.3.4
Using cached eth_keys-0.3.4-py3-none-any.whl (21 kB)
Collecting eth-keyfile<0.6.0,>=0.5.0
Using cached eth_keyfile-0.5.1-py3-none-any.whl (8.3 kB)
Collecting eth-utils<2.0.0,>=1.9.5
Using cached eth_utils-1.9.5-py3-none-any.whl (23 kB)
Collecting cytoolz<1.0.0,>=0.10.1
Using cached cytoolz-0.12.0-cp39-cp39-macosx_11_0_arm64.whl (367 kB)
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
Using cached pyrsistent-0.19.2-cp39-cp39-macosx_10_9_universal2.whl (82 kB)
Collecting pyparsing!=3.0.5,>=2.0.2
Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting idna<4,>=2.5
Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2022.9.24-py3-none-any.whl (161 kB)
Collecting urllib3<1.27,>=1.21.1
Using cached urllib3-1.26.13-py2.py3-none-any.whl (140 kB)
Requirement already satisfied: mypy-extensions>=0.3.0 in ./cairo_venv/lib/python3.9/site-packages (from typing-inspect>=0.7.1->marshmallow-dataclass>=7.1.0->cairo-lang) (0.4.3)
Collecting typing-extensions>=3.7.4
Using cached typing_extensions-4.4.0-py3-none-any.whl (26 kB)
Collecting toolz>=0.8.0
Using cached toolz-0.12.0-py3-none-any.whl (55 kB)
Requirement already satisfied: varint in ./cairo_venv/lib/python3.9/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->Web3->cairo-lang) (1.0.2)
Requirement already satisfied: netaddr in ./cairo_venv/lib/python3.9/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->Web3->cairo-lang) (0.8.0)
Collecting base58
Using cached base58-2.1.1-py3-none-any.whl (5.6 kB)
Using legacy 'setup.py install' for cairo-lang, since package 'wheel' is not installed.
Using legacy 'setup.py install' for fastecdsa, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pycryptodome, since package 'wheel' is not installed.
Using legacy 'setup.py install' for websockets, since package 'wheel' is not installed.
Using legacy 'setup.py install' for parsimonious, since package 'wheel' is not installed.
Installing collected packages: fastecdsa, bitarray, websockets, urllib3, typing-extensions, typeguard, toolz, tomli, sympy, six, PyYAML, pyrsistent, pyparsing, pycryptodome, protobuf, prometheus-client, pluggy, pipdeptree, numpy, multidict, idna, hexbytes, frozenlist, exceptiongroup, eth-typing, eth-hash, charset-normalizer, certifi, cachetools, base58, attrs, async-timeout, yarl, typing-inspect, requests, parsimonious, packaging, multiaddr, jsonschema, ecdsa, cytoolz, aiosignal, pytest, marshmallow, ipfshttpclient, eth-utils, aiohttp, rlp, pytest-asyncio, marshmallow-oneofschema, marshmallow-enum, marshmallow-dataclass, eth-keys, eth-abi, eth-rlp, eth-keyfile, eth-account, Web3, cairo-lang
Running setup.py install for fastecdsa ... error
error: subprocess-exited-with-error

× Running setup.py install for fastecdsa did not run successfully.
│ exit code: 1
╰─> [51 lines of output]
running install
/Users/samridhsingh/cairo_venv/lib/python3.9/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-13-arm64-cpython-39
creating build/lib.macosx-13-arm64-cpython-39/fastecdsa
copying fastecdsa/benchmark.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa
copying fastecdsa/util.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa
copying fastecdsa/init.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa
copying fastecdsa/keys.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa
copying fastecdsa/curve.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa
copying fastecdsa/point.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa
copying fastecdsa/ecdsa.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa
creating build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_point.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_keygen.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_nonce_generation.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_key_recovery.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_key_export_import.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_whycheproof_vectors.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/init.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_prehashed.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_brainpool_ecdh.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_rfc6979_ecdsa.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_whitespace_parsing.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_prime_field_curve_math.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
copying fastecdsa/tests/test_p256_ecdsa.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests
creating build/lib.macosx-13-arm64-cpython-39/fastecdsa/encoding
copying fastecdsa/encoding/pem.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/encoding
copying fastecdsa/encoding/util.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/encoding
copying fastecdsa/encoding/init.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/encoding
copying fastecdsa/encoding/sec1.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/encoding
copying fastecdsa/encoding/der.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/encoding
copying fastecdsa/encoding/asn1.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/encoding
creating build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests/encoding
copying fastecdsa/tests/encoding/test_sec1.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests/encoding
copying fastecdsa/tests/encoding/init.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests/encoding
copying fastecdsa/tests/encoding/test_der.py -> build/lib.macosx-13-arm64-cpython-39/fastecdsa/tests/encoding
running build_ext
building 'fastecdsa.curvemath' extension
creating build/temp.macosx-13-arm64-cpython-39
creating build/temp.macosx-13-arm64-cpython-39/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -Isrc/ -I/Users/samridhsingh/cairo_venv/include -I/opt/homebrew/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/curve.c -o build/temp.macosx-13-arm64-cpython-39/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
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> fastecdsa

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

@milancermak
Copy link

Have a look at the solutions presented here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants