Trying to install pycrypto on Mac OSX mavericks

前端 未结 14 2107
逝去的感伤
逝去的感伤 2020-12-28 17:25

I am currently trying to install pycrypto and when I execute python setup.py build I receive this following error:

cc -bundle -undefined dynamic_lookup -arch         


        
相关标签:
14条回答
  • 2020-12-28 17:45

    I ran into the same issue and was able to fix it by installing gmp:

    brew install gmp
    

    Then I nuked my build directory and started over with the pycrypto install and it succeeded.

    This also fixes the warning message during pycrypto's configure script:

    warning: GMP or MPIR library not found; Not building Crypto.PublickKey._fastmath
    

    See related question.

    0 讨论(0)
  • 2020-12-28 17:52

    For installation of PyCrypto use MacPorts and following command. I tested it on the newest version of Mac OS X - Yosemite:

    Python Version 2.7:

    sudo port install py27-crypto
    

    Python Version 3.4:

    sudo port install py34-crypto
    
    0 讨论(0)
  • 2020-12-28 17:54

    Install homebrew (single line for installation at bottom of page), then try:

    $ sudo pip install pycrypto
    
    0 讨论(0)
  • 2020-12-28 17:55

    If I'm not mistaken, pip and homebrew are both package managers, but homebrew is built on ruby and pip is built on python.

    $ sudo pip install pycrypto
    

    This command you referred to needs pip installed, not homebrew.

    This way to get pip

    0 讨论(0)
  • 2020-12-28 17:56

    This did it for me:

      sudo port install gmp
      sudo ln -s  /opt/local/lib/libgmp.dylib  /usr/lib/libgmp.dylib  
      ARCHFLAGS=-Wno-error CFLAGS=-I/opt/local/include sudo -E pip install pycrypto
    
    0 讨论(0)
  • 2020-12-28 17:57

    To install pycrypto run the following command

    $ CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/Cellar/gmp/6.1.2_2/lib pip install pycrypto
    
    0 讨论(0)
提交回复
热议问题