pip install error crytography and openssl

The error:

Command “/usr/bin/python -u -c “import setuptools, tokenize;__file__=’/tmp/pip-build-4Y5rX6/cryptography/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)(__file__).read().replace(‘\r\n’, ‘\n’), __file__, ‘exec’))” install — record /tmp/pip-8Uj5S2-record/install-record.txt — single-version-externally-managed — compile” failed with error code 1 in /tmp/pip-build-4Y5rX6/cryptography/

The solution:

Had to soft reboot openstack instance of the server. The error is caused by lack of Swap space on the server.