-
-
Notifications
You must be signed in to change notification settings - Fork 113
Description
Hey there, I'm trying this library out on a fresh DigitalOcean droplet using Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-153-generic x86_64) and Python 2
In the README.rst, for ubuntu 14.04 and python 2 it says to run apt-get install python-dev python-cffi libxml2-dev libxslt1-dev libssl-dev, followed by pip install signxml, however this ended up having trouble installing cryptography, which had trouble installing cffi:
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I needed to apt-get install libffi-dev build-essential, and then pip install cryptography worked.
Later, following the first example, I got an ImportError running XMLSigner().sign(...)
>>> signed_root = XMLSigner().sign(root, key=key)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/signxml/__init__.py", line 345, in sign
signed_info_element, signature_value_element = self._build_sig(sig_root, reference_uris, c14n_inputs)
File "/usr/local/lib/python2.7/dist-packages/signxml/__init__.py", line 489, in _build_sig
digest = self._get_digest(payload_c14n, self._get_digest_method_by_tag(self.digest_alg))
File "/usr/local/lib/python2.7/dist-packages/signxml/__init__.py", line 154, in _get_digest
hasher = Hash(algorithm=digest_algorithm, backend=default_backend())
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/__init__.py", line 15, in default_backend
from cryptography.hazmat.backends.openssl.backend import backend
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
from cryptography.hazmat.backends.openssl.backend import backend
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 16, in <module>
from cryptography import utils, x509
File "/usr/local/lib/python2.7/dist-packages/cryptography/x509/__init__.py", line 8, in <module>
from cryptography.x509.base import (
File "/usr/local/lib/python2.7/dist-packages/cryptography/x509/base.py", line 16, in <module>
from cryptography.x509.extensions import Extension, ExtensionType
File "/usr/local/lib/python2.7/dist-packages/cryptography/x509/extensions.py", line 10, in <module>
import ipaddress
ImportError: No module named ipaddress
I fixed this by running pip install py2-ipaddress and everything pretty well worked after that.
To summarize, I think the apt-get call is missing libffi-dev and build-essential, and there's a missing pip dependency on py2-ipaddress when using Ubuntu 14 and Python 2.