6

Mac 下安装 cryptography 失败

 2 years ago
source link: https://www.qikqiak.com/post/install-cryptography-failed-in-mac/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Mac 下安装 cryptography 失败-阳明的博客|Kubernetes|Istio|Prometheus|Python|Golang|云原生

Mac下面安装cryptography依赖包,始终报错,出现'openssl/opensslv.h' file not found的错误。

$ pip install cryptography
...
 building '_openssl' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c build/temp.macosx-10.12-intel-2.7/_openssl.c -o build/temp.macosx-10.12-intel-2.7/build/temp.macosx-10.12-intel-2.7/_openssl.o
build/temp.macosx-10.12-intel-2.7/_openssl.c:434:10: fatal error: 'openssl/opensslv.h' file not found
#include <openssl/opensslv.h>
         ^
1 error generated.
error: command 'cc' failed with exit status 1
...

这是因为找不到openssl的头文件,可以使用brew命令进行安装:

$ brew install openssl

如果安装完成以后还是会出现上面的错误的话,就是环境变量的问题了,需要重新指定openssl的路径安装:

$ env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography

这样就可以搞定了~~~

微信公众号

扫描下面的二维码关注我们的微信公众帐号,在微信公众帐号中回复◉加群◉即可加入到我们的 kubernetes 讨论群里面共同学习。

「真诚赞赏,手留余香」

Related Issues not found

Please contact @cnych to initialize the comment

✕ Error. Try later. You have blocked Push Notifications. Follow these instructions to enable Push Notifications. Subscribe to receive push notifications on latest updates You are unsubscribed to Push Notifications You are subscribed to Push Notifications SUBSCRIBE SUBSCRIBE UNSUBSCRIBE ⚡ by  Webpushr

Logo 阳明的博客 是否想要接收本站的内容更新呢? YES NOT YET Cookie & Data Storage Detail Cookies & Server Data Storage Disclosure Below are all cookies & data points that will be stored to help us enable web push notifications. Go Back Cookies (3) A Cookie is a small piece of data that we will store in your browser. Show cookie info _webpushrPromptAction This cookie is stored if you do not accept to receive push notifications from us and dismiss this prompt. This helps us remember your decision.

_webpushrEndPoint This cookie stores a unique URL associated with your push subscription. It is only stored if you accept to receive push notifications from us. This helps us successfully manage and send push notifications to you.

_webpushrLastVisit This cookie stores timestamp associated with your last visit on our site. It is only stored if you accept to receive push notifications from us. This helps us successfully manage and send push notifications to you. Server Data Storage (11) Server Data Storage are small data points that will be securely stored by us only if you accept to receive push notifications. Show data info date Timestamp associated with your push subscription start date

endpoint A custom URL and associated encrypted keys pointing to a push server that enable us to send you push notifications.

timezone Your local timezone relative to GMT

device_type Your device type. Possible values are Mobile or Desktop.

operating_system Your operating system such as Mac OS, Windows, Android, etc.

browser Your browser detail, such as Chrome, Firefox, Opera, Edge, etc.

ip_address Your IP address city Geographic Location: City

state Geographic Location: State

country Geographic Location: Country

session_date Date corresponding to your last visit on our site

Powered By Webpushr


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK