简体   繁体   English

在Mac 10.9.6中安装pycrypto时出错

[英]Error installing pycrypto in mac 10.9.6

I am trying to install 'fabric'. 我正在尝试安装“面料”。 I tried using 'pip install fabric' and the installation is failing when it is trying to install the 'pycrypto' 我尝试使用“ pip install fabric”,并且在尝试安装“ pycrypto”时安装失败

I see it is fetching the 2.6.1 version. 我看到它正在获取2.6.1版本。 I tried installing lower versions and I am getting same error. 我尝试安装较低版本,但遇到相同错误。

'sudo easy_install fabric' also throws same error. “ sudo easy_install fabric”也会引发相同的错误。

I also have the gmplib installed. 我还安装了gmplib。 I have the lib file in these places /usr/lib/libgmp.dylib /usr/local/lib/libgmp.dylib 我在以下位置有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.

This is the error i get when i execute 'fab' 这是我执行“ 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

Got it working after installing xcode. 安装xcode后,它可以工作了。

pycrypto was installed by default once xcode was installed and fabric is working now. 一旦安装了xcode并且Fabric现在可以正常工作,则默认情况下会安装pycrypto。

(I should have mentioned that I am new to MAC in the question) (我应该提到我是MAC新手)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM