Comments (19)
To make mine more generic, try:
CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip install ecdsa fastecdsa sympy
from nile.
This seems to be an issue with the Cairo programming language on apple's M1 computers. I read on the Cairo discord that you were able to solve it. Leaving a few success stories taken from the Cairo discord server for anybody stumbling upon this very problem:
1. @guiltygyoza
Replying to myself for a working solution for M1-chip machine, the key to which is to install the x86 homebrew and use that to install & link gmp
- Duplicate the terminal app and name it something else e.g. terminal_rosetta; set it to Open using Rosetta . Reference: https://medium.com/swlh/run-x86-terminal-apps-like-homebrew-on-your-new-m1-mac-73bdc9b0f343
- In terminal_rosetta, open a virtual environment running python 3.7
- Install the x86 homebrew by running arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" . It will get installed in /usr/local/
- Use the x86 brew to install gmp by running /usr/local/bin/brew install gmp
- Use the x86 brew to link gmp by running /usr/local/bin/brew link gmp
- Follow the rest of the quickstart tutorial at https://www.cairo-lang.org/docs/quickstart.html
2. @milancermak
in case anyone else runs into this error fatal error: 'gmp.h' file not found when installing the necessary Cairo packages on a M1 Mac, after brew install gmp, try this:
CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip install ecdsa fastecdsa sympy
3. @howardpen9
The python library fastecdsa has the issued in new MacOS or M1 chips I think!! You can't install the latest version. I reinstall the each version until the fastecdsa==1.7.5 to run the code successfully! Finally!
4. myself!
None of the above worked for me :(
So I ended up spinning up a docker instance with ubuntu and installed Cairo in it.
from nile.
I tried the @milancermak solution, but on my macOS Monterey (12.1) on M1, pip
is not found, while pip3
is.
So modifying Milan's command to the following, I was then able to pip3 install cairo-lang
successfully.
CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip3 install ecdsa fastecdsa sympy
from nile.
I would suggest pinning this issue @martriay
from nile.
Edited!
from nile.
To fix this error:
OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': dlopen(libcairo.so.2, 0x0002): tried: 'libcairo.so.2' (no such file), '/usr/local/lib/libcairo.so.2' (no such file), '/usr/lib/libcairo.so.2' (no such file), '/Users/soma/Development/mkdocs-material-insiders/libcairo.so.2' (no such file), '/usr/local/lib/libcairo.so.2' (no such file), '/usr/lib/libcairo.so.2' (no such file)
cannot load library 'libcairo.2.dylib': dlopen(libcairo.2.dylib, 0x0002): tried: 'libcairo.2.dylib' (no such file), '/usr/local/lib/libcairo.2.dylib' (no such file), '/usr/lib/libcairo.2.dylib' (no such file), '/Users/soma/Development/mkdocs-material-insiders/libcairo.2.dylib' (no such file), '/usr/local/lib/libcairo.2.dylib' (no such file), '/usr/lib/libcairo.2.dylib' (no such file)
cannot load library 'libcairo-2.dll': dlopen(libcairo-2.dll, 0x0002): tried: 'libcairo-2.dll' (no such file), '/usr/local/lib/libcairo-2.dll' (no such file), '/usr/lib/libcairo-2.dll' (no such file), '/Users/soma/Development/mkdocs-material-insiders/libcairo-2.dll' (no such file), '/usr/local/lib/libcairo-2.dll' (no such file), '/usr/lib/libcairo-2.dll' (no such file)
run this command:
ln -s /opt/homebrew/lib/libcairo.2.dylib .
from nile.
@milancermak trick fixed it for me.
probably worth editing https://www.cairo-lang.org/docs/quickstart.html#quickstart
from nile.
Got it to work using:
- Pipenv (my preference) but normal
venv
should be fine - MacOS's Python 3.8
- @milancermak 's Point 2
- @howardpen9 's fastecdsa==1.7.5
from nile.
I am also using M1 Chip, the command below also works for me
CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip install ecdsa fastecdsa sympy
And me on Mac m1 pro chip
from nile.
Done
from nile.
To make mine more generic, try:
CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip install ecdsa fastecdsa sympy
Worked for me! Appreciate it.
from nile.
Option 1 worked for me, thank you!
from nile.
fastecdsa==1.7.5
this works for me. thank you so much. but compiling doesnt work :(
from nile.
some kind soul posted this and it works for me https://th0rgal.medium.com/the-easiest-way-to-setup-a-cairo-dev-environment-8f2a63610d46
from nile.
CFLAGS=-I
brew --prefix gmp
/include LDFLAGS=-Lbrew --prefix gmp
/lib pip3 install ecdsa fastecdsa sympy
Thanks, I've been trying to figure this out for days. This time it happened
from nile.
To make mine more generic, try:
CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip install ecdsa fastecdsa sympy
I'm using M1 chip, this works for me, thanks!
from nile.
I am also using M1 Chip, the command below also works for me
CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip install ecdsa fastecdsa sympy
from nile.
Compiling works for me, but not execution. I'm getting the same error as this one here: AntonKueltz/fastecdsa#74 (comment)
Probably will just spin up a docker container, but would love to know if execution works for any of you!
from nile.
I tried the @milancermak solution, but on my macOS Monterey (12.1) on M1,
pip
is not found, whilepip3
is. So modifying Milan's command to the following, I was then able topip3 install cairo-lang
successfully.CFLAGS=-I`brew --prefix gmp`/include LDFLAGS=-L`brew --prefix gmp`/lib pip3 install ecdsa fastecdsa sympy
Thx! This worked for me! I ran this command after completely removing python on machine (reinstalling python3.9).
from nile.
Related Issues (20)
- artifacts/ folder missing in base project .gitignore
- nile deploy command doesn't accept hex arguments in calldata
- Handle Exceptions in CLI scope
- update goerli2 chain id
- Registering duplicate deployment address will delete deployment from json HOT 2
- Remove accounts.json from nile init (never used)
- Add tests for accounts.py
- nile setup failed HOT 1
- Add nile utils documentation to the docsite HOT 1
- Declaring a contract causes "Requested contract address is not deployed" HOT 2
- Refactor `call_or_invoke` method to `call` HOT 1
- Update docs from transaction flow refactor
- `nile run` doesn't bubble up script exceptions
- Support `EthAccount` signer and account type
- add transaction API/lifecycle to docs
- Declare transaction fails when the declarations file contains an empty line
- Increase max_fee above estimated amount
- Add EthAccount support as plugin
- Bump cairo-lang dependency to 0.11
- Does it support deploying contract with arguments in the latest version? And then, how to do it? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nile.