无法在OSX 10.8上安装加密0.9.3

时间:2015-07-21 07:30:13

标签: cryptography pycparser

我是python和django的新手。自最新发布的django以来,我一直在努力在本地安装我们公司的开发包。这是消息堆栈:

Installing django.
django: There's no directory named after our project. Probably you want to run 'bin/django startproject project'
Getting distribution for 'cryptography>=0.7'.

Installed /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs/cffi-1.1.2-py2.7-macosx-10.8-x86_64.egg
Searching for ipaddress
Reading https://pypi.python.org/simple/ipaddress/
Best match: ipaddress 1.0.14
Downloading https://pypi.python.org/packages/source/i/ipaddress/ipaddress-1.0.14.tar.gz#md5=e2f2f6593b2b8a7e8abba0fbdf33f046
Processing ipaddress-1.0.14.tar.gz
Writing /var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/temp/easy_install-Q3JRP9/ipaddress-1.0.14/setup.cfg
Running ipaddress-1.0.14/setup.py -q bdist_egg --dist-dir /var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/temp/easy_install-Q3JRP9/ipaddress-1.0.14/egg-dist-tmp-QxA7aQ
zip_safe flag not set; analyzing archive contents...
Copying ipaddress-1.0.14-py2.7.egg to /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs

Installed /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs/ipaddress-1.0.14-py2.7.egg
Searching for enum34
Reading https://pypi.python.org/simple/enum34/
Best match: enum34 1.0.4
Downloading https://pypi.python.org/packages/source/e/enum34/enum34-1.0.4.zip#md5=9843e97527f3126c851df7afeb0524b3
Processing enum34-1.0.4.zip
Writing /var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/temp/easy_install-GiulwR/enum34-1.0.4/setup.cfg
Running enum34-1.0.4/setup.py -q bdist_egg --dist-dir /var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/temp/easy_install-GiulwR/enum34-1.0.4/egg-dist-tmp-NSgjuy
zip_safe flag not set; analyzing archive contents...
Copying enum34-1.0.4-py2.7.egg to /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs

Installed /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs/enum34-1.0.4-py2.7.egg
Searching for six>=1.4.1
Reading https://pypi.python.org/simple/six/
Best match: six 1.9.0
Downloading https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz#md5=476881ef4012262dfc8adc645ee786c4
Processing six-1.9.0.tar.gz
Writing /var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/temp/easy_install-xWVhoY/six-1.9.0/setup.cfg
Running six-1.9.0/setup.py -q bdist_egg --dist-dir /var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/temp/easy_install-xWVhoY/six-1.9.0/egg-dist-tmp-WO8SGv
no previously-included directories found matching 'documentation/_build'
zip_safe flag not set; analyzing archive contents...
six: module references __path__
creating /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs/six-1.9.0-py2.7.egg
Extracting six-1.9.0-py2.7.egg to /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs

Installed /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs/six-1.9.0-py2.7.egg
Searching for pyasn1
Reading https://pypi.python.org/simple/pyasn1/
Best match: pyasn1 0.1.8
Downloading https://pypi.python.org/packages/2.7/p/pyasn1/pyasn1-0.1.8-py2.7.egg#md5=59f23a2692b9b4bc7901d166eba69167
Processing pyasn1-0.1.8-py2.7.egg
Moving pyasn1-0.1.8-py2.7.egg to /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs

Installed /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs/pyasn1-0.1.8-py2.7.egg
Searching for idna
Reading https://pypi.python.org/simple/idna/
Best match: idna 2.0
Downloading https://pypi.python.org/packages/source/i/idna/idna-2.0.tar.gz#md5=bd17a9d15e755375f48a62c13b25b801
Processing idna-2.0.tar.gz
Writing /var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/temp/easy_install-ne4LbF/idna-2.0/setup.cfg
Running idna-2.0/setup.py -q bdist_egg --dist-dir /var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/temp/easy_install-ne4LbF/idna-2.0/egg-dist-tmp-8YLfu7
warning: no previously-included files matching '*.pyc' found under directory 'tools'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
zip_safe flag not set; analyzing archive contents...
Copying idna-2.0-py2.7.egg to /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs

Installed /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs/idna-2.0-py2.7.egg
Searching for pycparser
Reading https://pypi.python.org/simple/pycparser/
Best match: pycparser 2.14
Downloading https://pypi.python.org/packages/source/p/pycparser/pycparser-2.14.tar.gz#md5=a2bc8d28c923b4fe2b2c3b4b51a4f935
Processing pycparser-2.14.tar.gz
Writing /var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/temp/easy_install-M45io9/pycparser-2.14/setup.cfg
Running pycparser-2.14/setup.py -q bdist_egg --dist-dir /var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/temp/easy_install-M45io9/pycparser-2.14/egg-dist-tmp-TZWoS1
warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
warning: no previously-included files matching 'lextab.*' found under directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
warning: no previously-included files matching 'lextab.*' found under directory 'examples'
zip_safe flag not set; analyzing archive contents...
Copying pycparser-2.14-py2.7.egg to /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs

Installed /private/var/folders/hf/y3d63zk55893w65jr6dxpk5m0000gn/T/easy_install-bi2ZfW/cryptography-0.9.3/.eggs/pycparser-2.14-py2.7.egg
no previously-included directories found matching 'docs/_build'
warning: no previously-included files matching '*' found under directory 'vectors'
Undefined symbols for architecture x86_64:
  "_EC_GFp_nistp224_method", referenced from:
      __cffi_f_EC_GFp_nistp224_method in _Cryptography_cffi_a269d620xd5c405b7.o
  "_EC_GFp_nistp256_method", referenced from:
      __cffi_f_EC_GFp_nistp256_method in _Cryptography_cffi_a269d620xd5c405b7.o
  "_EC_GFp_nistp521_method", referenced from:
      __cffi_f_EC_GFp_nistp521_method in _Cryptography_cffi_a269d620xd5c405b7.o
  "_EC_curve_nid2nist", referenced from:
      __cffi_f_EC_curve_nid2nist in _Cryptography_cffi_a269d620xd5c405b7.o
  "_SSL_CTX_set_alpn_protos", referenced from:
      __cffi_f_SSL_CTX_set_alpn_protos in _Cryptography_cffi_a269d620xd5c405b7.o
  "_SSL_CTX_set_alpn_select_cb", referenced from:
      __cffi_f_SSL_CTX_set_alpn_select_cb in _Cryptography_cffi_a269d620xd5c405b7.o
  "_SSL_get0_alpn_selected", referenced from:
      __cffi_f_SSL_get0_alpn_selected in _Cryptography_cffi_a269d620xd5c405b7.o
  "_SSL_set_alpn_protos", referenced from:
      __cffi_f_SSL_set_alpn_protos in _Cryptography_cffi_a269d620xd5c405b7.o
  "_X509_VERIFY_PARAM_set1_email", referenced from:
      __cffi_f_X509_VERIFY_PARAM_set1_email in _Cryptography_cffi_a269d620xd5c405b7.o
  "_X509_VERIFY_PARAM_set1_host", referenced from:
      __cffi_f_X509_VERIFY_PARAM_set1_host in _Cryptography_cffi_a269d620xd5c405b7.o
  "_X509_VERIFY_PARAM_set1_ip", referenced from:
      __cffi_f_X509_VERIFY_PARAM_set1_ip in _Cryptography_cffi_a269d620xd5c405b7.o
  "_X509_VERIFY_PARAM_set1_ip_asc", referenced from:
      __cffi_f_X509_VERIFY_PARAM_set1_ip_asc in _Cryptography_cffi_a269d620xd5c405b7.o
  "_X509_VERIFY_PARAM_set_hostflags", referenced from:
      __cffi_f_X509_VERIFY_PARAM_set_hostflags in _Cryptography_cffi_a269d620xd5c405b7.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1
An error occurred when trying to install cryptography 0.9.3. Look above this message for any errors that were output by easy_install.
While:
  Installing django.
  Getting distribution for 'cryptography>=0.7'.
Error: Couldn't install: cryptography 0.9.3

我跑了:

brew install openssl
brew install pkg-config libffi
env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/usr/local/opt/openssl/lib" CFLAGS="-I/usr/local/opt/openssl/include"
pip install cffi

我注意到我的机器已经有了旧版本的openssl所以我创建了一个新的符号链接:

openssl version
OpenSSL 1.0.1f 6 Jan 2014
mv /sw/bin/openssl /sw/bin/openssl_OLD
ln -s /usr/local/Cellar/openssl/1.0.2d_1/bin/openssl /sw/bin/openssl
openssl version
OpenSSL 1.0.2d 9 Jul 2015

我还可以确认我有64位机器:

file /sw/lib/libffi.6.dylib
/sw/lib/libffi.6.dylib: Mach-O 64-bit dynamically linked shared library

运行具有cryptography == 0.7依赖关系的相同脚本会导致相同的错误。

我正在运行GCC 4.2

到目前为止,我没有尝试过更改django buildout中出现的错误:(当我运行pip install cryptography时,它似乎安装得很干净但是这个buildout脚本坚持安装本地副本。

有没有人对我接下来应该尝试什么有任何建议?我的想法已经不多了。

0 个答案:

没有答案