【问题标题】:Error installing pycrypto in mac 10.9.6在 mac 10.9.6 中安装 pycrypto 时出错
【发布时间】:2014-08-27 06:25:46
【问题描述】:

我正在尝试安装“面料”。我尝试使用“pip install fabric”,但在尝试安装“pycrypto”时安装失败

我看到它正在获取 2.6.1 版本。我尝试安装较低版本,但我得到了同样的错误。

'sudo easy_install fabric' 也会抛出同样的错误。

我也安装了 gmplib。我在这些地方有 lib 文件 /usr/lib/libgmp.dylib /usr/local/lib/libgmp.dylib

pip install fabric Requirement already satisfied (use --upgrade to upgrade): fabric in /Library/Python/2.7/site-packages Requirement already satisfied (use --upgrade to upgrade): paramiko>=1.10.0 in /Library/Python/2.7/site-packages/paramiko-1.14.1-py2.7.egg (from fabric) Downloading/unpacking pycrypto>=2.1,!=2.4 (from paramiko>=1.10.0->fabric) Downloading pycrypto-2.6.1.tar.gz (446kB): 446kB downloaded Running setup.py (path:/private/tmp/pip_build_root/pycrypto/setup.py) egg_info for package pycrypto Requirement already satisfied (use --upgrade to upgrade): ecdsa in /Library/Python/2.7/site-packages/ecdsa-0.11-py2.7.egg (from paramiko>=1.10.0->fabric) Installing collected packages: pycrypto Running setup.py install for pycrypto checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for __gmpz_init in -lgmp... yes checking for __gmpz_init in -lmpir... no checking whether mpz_powm is declared... yes checking whether mpz_powm_sec is declared... yes checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for inttypes.h... (cached) yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking wchar.h usability... yes checking wchar.h presence... yes checking for wchar.h... yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for int64_t... yes checking for int8_t... yes checking for size_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memmove... yes checking for memset... yes configure: creating ./config.status config.status: creating src/config.h building 'Crypto.PublicKey._fastmath' extension cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -Wall -Wstrict-prototypes -Wshorten-64-to-32 -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_fastmath.c -o build/temp.macosx-10.9-intel-2.7/src/_fastmath.o src/_fastmath.c:83:13: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32] size = p->ob_size; ~ ~~~^~~~~~~ src/_fastmath.c:86:10: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32] size = -p->ob_size; ~ ^~~~~~~~~~~ src/_fastmath.c:113:49: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int size = (mpz_sizeinbase (m, 2) + SHIFT - 1) / SHIFT; ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ src/_fastmath.c:1310:12: warning: implicit conversion loses integer precision: 'unsigned long' to 'unsigned int' [-Wshorten-64-to-32] offset = mpz_get_ui (mpz_offset); ~ ^~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/gmp.h:840:20: note: expanded from macro 'mpz_get_ui' #define mpz_get_ui __gmpz_get_ui ^ src/_fastmath.c:1360:10: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] return return_val; ~~~~~~ ^~~~~~~~~~ src/_fastmath.c:1373:27: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] rounds = mpz_get_ui (n) - 2; ~ ~~~~~~~~~~~~~~~^~~ src/_fastmath.c:1433:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] return return_val; ~~~~~~ ^~~~~~~~~~ src/_fastmath.c:1545:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] else if (result < 0) ~~~~~~ ^ ~ src/_fastmath.c:1621:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] else if (result < 0) ~~~~~~ ^ ~ 9 warnings generated. src/_fastmath.c:1545:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] else if (result < 0) ~~~~~~ ^ ~ src/_fastmath.c:1621:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] else if (result < 0) ~~~~~~ ^ ~ 2 warnings generated.

这是我执行“fab”时遇到的错误

Traceback (most recent call last): File "/usr/local/bin/fab", line 5, in from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in working_set.require(requires) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require needed = self.resolve(parse_requirements(requirements)) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve raise DistributionNotFound(req) # XXX put more info here pkg_resources.DistributionNotFound: pycrypto>=2.1,!=2.4

【问题讨论】:

    标签: python pycrypto


    【解决方案1】:

    安装 xcode 后就可以使用了。

    一旦安装了 xcode 并且结构现在可以工作,就会默认安装 pycrypto。

    (我应该在问题中提到我是 MAC 新手)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-22
      • 1970-01-01
      • 2019-01-20
      相关资源
      最近更新 更多