Mac 下安装 cryptography 失败
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
依赖包,始终报错,出现'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
阳明的博客 是否想要接收本站的内容更新呢? 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
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK