I'm trying to install the cryptography python library using pip (so I can use paramiko), but I'm getting a gcc error.
Some background: this is on a CentOS 5.11 VM that I was given with Python 2.4.3 installed. I installed Python 2.7.12 alongside it, and had to struggle a little bit to get all the dependencies for cryptography installed.
When I run the command
sudo pip2.7 install cryptography
I first get an SNIMissingWarning error (which I think is tangential, but I'll give details at the end of the question, in case it's not). Then I get several hundred lines of install logs, finally ending with:
build/temp.linux-i686-2.7/_openssl.c:72077: error: storage class specified for parameter ‘_cffi_type_context’
build/temp.linux-i686-2.7/_openssl.c:72077: error: parameter ‘_cffi_type_context’ is initialized
build/temp.linux-i686-2.7/_openssl.c:72120: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
build/temp.linux-i686-2.7/_openssl.c:72122: error: old-style parameter declarations in prototyped function definition
build/temp.linux-i686-2.7/_openssl.c:591: error: parameter name omitted
build/temp.linux-i686-2.7/_openssl.c:72122: error: expected ‘{’ at end of input
error: command 'gcc' failed with exit status 1
Command "/usr/local/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-build-RGpvd5/cryptography/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-kwpB5q-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-RGpvd5/cryptography/
Since it's a gcc error, I'm not sure what to do. I looked for information about it, but I don't know much about C, so the answers didn't mean much to me. I couldn't find anything relating to installing cryptography for python discussing this specific error.
Any ideas what may be happening?
In more detail, the SNIMissingWarning message I get is:
/usr/local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
Using cached cryptography-1.6.tar.gz
The readthedocs.io link has this to say about the error: "This happens on Python 2 versions older than 2.7.9. These older versions lack SNI support." Since I am using 2.7.12, hopefully that's not a problem. It further suggests installing urllib3 with the secure option, which I tried, using
pip2.7 install urllib3[secure]
This automatically attempted to install cryptography, and that failed with a gcc error, the same way as before.