I'm installing PyCrypto because it is a dependency of another package. The installation always ends in an error in Termux (pip install pycrypto):

Command "/data/data/com.termux/files/usr/bin/python -u -c "import setuptools, tokenize;__file__='/data/data/com.termux/files/usr/tmp/pip-install-ip9yqged/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /data/data/com.termux/files/usr/tmp/pip-record-_ac102nh/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-install-ip9yqged/pycrypto/

The other Python packages have so far installed succesfully.

  • PyCrypto uses C code that needs to be compiled when installed. Therefore you need a fully working C compiler/build environment (e.g. gcc/clang plus tools and develop libraries and headers).
    – Robert
    Oct 15, 2018 at 17:33

1 Answer 1


Try installing a C compiler like Clang provided by Termux:

apt install clang

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .