Installing PyCrypto on Ubuntu – fatal error on build March 4, 2023 by Tarik You need to install the Python development files. I believe this will do it: sudo apt-get install python-dev