How to install Python protocol module on OSX?

When I deploy my Google engine project, I get the following warning:

WARNING appengine_rpc.py:399 ssl module not found. Without the ssl module, the identity of the remote host cannot be verified, and connections may NOT be secure. To fix this, please install the ssl module from http://pypi.python.org/pypi/ssl. 

I downloaded the package, but when I try

 python setup.py build 

I get the following error output:

 looking for /usr/include/openssl/ssl.h looking for /usr/local/ssl/include/openssl/ssl.h looking for /usr/contrib/ssl/include/openssl/ssl.h Traceback (most recent call last): File "setup.py", line 167, in <module> ssl_incs, ssl_libs, libs = find_ssl() File "setup.py", line 142, in find_ssl raise Exception("No SSL support found") Exception: No SSL support found 

What do I need to do to install it, is it a path problem or something else?

+4
source share
3 answers

This is fixed by installing pycrypto first, following the instructions here and using the insight from the answer to this question .

The full command line that I used for a possible build was:

 CC='/usr/bin/gcc-4.0' python2.5 setup.py build 
+5
source

Apple stock python on 10.5 and 10.6 includes an ssl module (unclear about earlier versions):

 Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>> ssl.__file__ '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ssl.pyc' 

(out of 10.5.8)

In fact, you can get this error message from appengine_rpc.py even if you have ssl - you need to make sure your GAE download has:

 /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/cacerts/cacerts.txt 

If you have both of these things, try doing:

 import google.appengine.tools.https_wrapper 

Which should work with a stock of Apple python, but if the error messages are not more informative. If you have multiple pythons installed, so one of them twists GAE, be sure to use the Python Path preference in GAE to point to Apple Python.

+2
source

You may need to manually install openssl, although the headers must be placed in / usr / include using the default Xcode installation. (If you did not install Xcode, it is unlikely that you have gcc on your computer, and the build will fail later in the process.)

0
source

Source: https://habr.com/ru/post/1313295/


All Articles