Alexa Skill Development using flask-ask and ngrok

左心房为你撑大大i 提交于 2019-12-03 12:20:09

Ran into the same issue, you can fix it by downgrading cryptography to anything less than 2.2 for me.

pip install 'cryptography<2.2'

rpg711 gets all the credit (see comments the on original post)

I can confirm that this works with cryptography 2.1.4, not with 2.5 or 2.6 on Python 3.7 and Mac OS High Sierra. However on Mac OS there are other issues to get over first.

What I found is that installing crypotgraphy 2.1.4 ends with an error (as below). I hit this error at the very start of my flask-ask project and had to do a manual install of requirements before I started coding. When I finally started trying alexa, I got the same 500 error (as above) with cryptography 2.5 or 2.6. So reading that it has to be 2.1.4 I always got this error when trying to install that specific version:

    #include <openssl/opensslv.h>
             ^~~~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1

Having tried many things I tried the specific recommendation in this post (https://github.com/pyca/cryptography/issues/3489). Trying the export CPPFLAGS and LDFLAGS didn't seem to work, however the following did

pip3 install cryptography==2.1.4 --global-option=build_ext --global-option="-L/usr/local/opt/openssl/lib" --global-option="-I/usr/local/opt/openssl/include"

I am afraid I cannot say whether the things I tried before i.e. brew link openssl and setting the CPPFLAGS and LDFLAGS had an impact on the final result. I did not however do an update of openssl as in the post. I hope that helps, but I was not operating from a position of knowledge and was not sure whether I had the skills do a manual install of opsenssl as indicated further in the post.

I hope this helps as I had almost given up.

BTW: using ngrok's web interface/inspector I found really handy, i.e. being able to replay the amazon request time and time again was very, very handy for me as I made other errors before the cryptography issue.

Referring to this link helped me solve the problem. https://github.com/pyca/cryptography/issues/3489

Basically, by linking openssl in mac by $ brew link openssland installing cryptography==2.1.4, the problem was resolved.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!