2014-10-09 25 views
48

biegnę "sudo pip zainstalować psycopg2" i mam kilka produkcji, które wygląda jakbłąd instalacji psycopg2, biblioteki nie znaleziono -lssl

cc -DNDEBUG -g -fwrapv -Os ..... 
..... 
cc -DNDEBUG -g -fwrapv -Os ..... 
..... 

I w końcu mówi:

ld: library not found for -lssl 

clang: error: linker command failed with exit code 1 (use -v to see invocation) 

error: command 'cc' failed with exit status 1 

---------------------------------------- 
Cleaning up... 
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/bz/pvj1g9xj16d10pjjgbrfl3fw0000gn/T/pip_build_root/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bz/pvj1g9xj16d10pjjgbrfl3fw0000gn/T/pip-uE3thn-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/bz/pvj1g9xj16d10pjjgbrfl3fw0000gn/T/pip_build_root/psycopg2 
Storing debug log for failure in /Users/Tyler/Library/Logs/pip.log 

Running easy_install lub robi to od źródła zarówno dać mi ten sam błąd na końcu (część o biblioteki nie znaleziono -ls sl).


Running zainstalować napar (lub modernizacji) openssl daje poniżej

$ brew upgrade openssl 
Error: openssl-1.0.1h already installed 

Czy ktoś może mi pomóc?

Odpowiedz

-2

udało mi się go naprawić za pomocą:

brew unlink openssl && brew link openssl --force 

nie jestem pewien, jak to różni się od deinstalacji zaparzania/uaktualnień, które zrobiłem na OpenSSL w poprzednich próbach zrobiłem. Zakładam, że te operacje opuściły niektóre z "wadliwych" bibliotek współdzielonych, które uniemożliwiły działanie tego systemu. Zauważ, że to również naprawiono problemy z instalacją modułu kryptografii Pythona.

+4

otrzymuję ten błąd: 'Odmowa odwołuje : openssl' – Flimm

150

Dla każdego, kto szuka rozwiązania tego na MacOS Sierra 10.12: naprawiłem to przez zainstalowanie narzędzia wiersza poleceń:

xcode-select --install 

potem pip install psycopg2 powinno działać.

Jeśli tak nie jest, można też spróbować połączyć przeciwko OpenSSL piwny za:

env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2 

z zainstalowanym poprzez wywaru OpenSSL. Zauważ, że brew link openssl --force już nie działa:

$ brew link openssl --force                     17.5s 
Warning: Refusing to link: openssl 
Linking keg-only openssl means you may end up linking against the insecure, 
deprecated system OpenSSL while using the headers from Homebrew's openssl. 
Instead, pass the full include/library paths to your compiler e.g.: 
    -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib 

Jak @macho zaznacza poniżej, jeśli to nadal nie działa, może trzeba użyć opcji PIP, np --no-cache

env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip --no-cache install psycopg2 
+0

Długo się z tym zmagałem! Dziękuję bardzo!!! –

+5

Właściwie, 'xcode-select -install' może wystarczyć, powinno się użyć dostarczonego systemu' ssl'. Zaktualizuję mój komentarz powyżej. – sas

+6

Instalacja w xcode-select jest wystarczająco dobra dla systemu python. Ale nie działa w środowiskach wirtualnych. –

5

Uruchamiając brew link openssl pojawia się następujący komunikat:

$ brew link openssl 
Warning: Refusing to link: openssl 
Linking keg-only openssl means you may end up linking against the insecure, 
deprecated system OpenSSL while using the headers from Homebrew's openssl. 
Instead, pass the full include/library paths to your compiler e.g.: 
    -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib 

Po tej rady oto polecenie pip trzeba użyć:

$ pip install -r requirements.txt --global-option=build_ext --global-option="-I/usr/local/opt/openssl/include" --global-option="-L/usr/local/opt/openssl/lib" 
Powiązane problemy