 <p>You can fix this by uninstalling M2Crypto via pip, then installing the package python-m2crypto, and then to make sure install M2Crypto again </p> <pre><code>pip uninstall M2Crypto apt-get install python-m2crypto pip install M2Crypto </code></pre> <p>This solved for me</p>