簡體   English   中英

`pip install mysql-python`失敗,“ld:找不到-lssl的庫”

[英]`pip install mysql-python` fails with “ ld: library not found for -lssl”

運行pip install mysql-python失敗:

cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/_mysql.o -L/usr/local/Cellar/mysql/5.7.13/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.12-intel-2.7/_mysql.so
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

我假設這是一些尚未正確安裝的SSL庫。

有什么建議?

你需要找到你是否有openssl libs以及它們所在的位置:

sudo find / -name "openssl"

我明白了:

ls -lA /usr/local/opt/openssl/
total 1080
drwxr-xr-x   3 _  admin     102 May 25 14:55 .bottle
drwxr-xr-x   3 _  admin     102 May 25 14:55 .brew
-rw-r--r--   1 _  admin  497920 Jul 16 16:36 CHANGES
-rw-r--r--   1 _  admin     772 Jul 16 16:36 INSTALL_RECEIPT.json
-rw-r--r--   1 _  admin    6281 May 25 14:55 LICENSE
-rw-r--r--   1 _  admin   34649 May 25 14:55 NEWS
-rw-r--r--   1 _  admin    3282 May 25 14:55 README
drwxr-xr-x   4 _  admin     136 Jul 16 16:36 bin
drwxr-xr-x   3 _  admin     102 May 25 14:55 include
drwxr-xr-x  10 _  admin     340 May 25 14:55 lib
drwxr-xr-x   3 _  admin     102 May 25 14:55 share

要安裝python包,您需要使用:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM