Code Monkey home page Code Monkey logo

Comments (19)

milancermak avatar milancermak commented on August 24, 2024 52

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.

martriay avatar martriay commented on August 24, 2024 41

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

  1. 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
  2. In terminal_rosetta, open a virtual environment running python 3.7
  3. 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/
  4. Use the x86 brew to install gmp by running /usr/local/bin/brew install gmp
  5. Use the x86 brew to link gmp by running /usr/local/bin/brew link gmp
  6. 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.

clacladev avatar clacladev commented on August 24, 2024 12

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.

0xs34n avatar 0xs34n commented on August 24, 2024 3

I would suggest pinning this issue @martriay

from nile.

martriay avatar martriay commented on August 24, 2024 2

Edited!

from nile.

Samk13 avatar Samk13 commented on August 24, 2024 2

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.

machard avatar machard commented on August 24, 2024 1

@milancermak trick fixed it for me.
probably worth editing https://www.cairo-lang.org/docs/quickstart.html#quickstart

from nile.

daramir avatar daramir commented on August 24, 2024 1

Got it to work using:

from nile.

Coun1er avatar Coun1er commented on August 24, 2024 1

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.

martriay avatar martriay commented on August 24, 2024

Done

from nile.

QEDK avatar QEDK commented on August 24, 2024

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.

benminer avatar benminer commented on August 24, 2024

Option 1 worked for me, thank you!

from nile.

chee-chyuan avatar chee-chyuan commented on August 24, 2024

fastecdsa==1.7.5

this works for me. thank you so much. but compiling doesnt work :(

from nile.

chee-chyuan avatar chee-chyuan commented on August 24, 2024

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.

zinderud avatar zinderud commented on August 24, 2024

CFLAGS=-Ibrew --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.

clement-ux avatar clement-ux commented on August 24, 2024

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.

bleso-a avatar bleso-a commented on August 24, 2024

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.

emmaguo13 avatar emmaguo13 commented on August 24, 2024

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.

ccsols avatar ccsols commented on August 24, 2024

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

Thx! This worked for me! I ran this command after completely removing python on machine (reinstalling python3.9).

from nile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.