2015-07-21 2 views
1

Я новичок в python и django. Я изо всех сил пытаюсь установить пакет разработки нашей компании локально с момента выпуска django. Вот стопка сообщение:Невозможно установить криптографию 0.9.3 на OSX 10.8

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 

Запуск того же скрипта с зависимостью криптографии == 0.7 приводит к той же ошибке.

Я бегу GCC 4.2

Ничего я пытался до сих пор изменяет ошибку я получаю в Джанго билдаута :(Когда я бегу пип установить криптографию, кажется, установить чисто, но этот сценарий Buildout настаивает на установке локальная копия.

кто-нибудь есть какие-либо предложения о том, что я должен попробовать следующий? Я бегу из идей.

ответ

0

Так получается, что проблема была с brew install openssl версии 1.0.2d.

Я переключился T o используя port install openssl и те же флаги env, как описано в https://cryptography.io/en/latest/installation/ Это означает, что сборка успешно завершена.

Однако при попытке запустить ./bin/django migrate я получил другую ошибку:

raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e) 
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: dlopen(/Users/<user>/Sites/<site>/eggs/psycopg2-2.6-py2.7-macosx-10.8-x86_64.egg/psycopg2/_psycopg.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib 
    Referenced from: /usr/local/lib/libpq.5.dylib 
    Reason: image not found 

Это происходит потому, что MacPorts устанавливает libssl в/Opt/местные/Библиотека /. Я исправил это с дерзкой символической линией:

ln -s /opt/local/lib/ /usr/local/opt/openssl/lib 
Смежные вопросы