I'm running python 3.7.4 and trying to install pycryptodome 3.4.3 using pip. I getting the following error.
/usr/bin/ld: cannot find -lpython3.7m
Full output
Collecting pycryptodome==3.4.3
Using cached https://files.pythonhosted.org/packages/45/ef/4514a01be3d8f5383cd12fc5612ffd8a2508ac7e7ff6bde2da708e71c9a3/pycryptodome-3.4.3.tar.gz
Installing collected packages: pycryptodome
Running setup.py install for pycryptodome ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ow1nicnc/pycryptodome/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-ktneq5lj-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/Crypto
copying lib/Crypto/__init__.py -> build/lib.linux-x86_64-3.7/Crypto
creating build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/_mode_ctr.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/_mode_ofb.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/_mode_siv.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/ChaCha20.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/ARC2.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/_mode_eax.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/PKCS1_OAEP.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/CAST.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/_mode_gcm.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/_mode_cfb.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/ARC4.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/_mode_ocb.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/DES.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
copying lib/Crypto/Cipher/__init__.py -> build/lib.linux-x86_64-3.7/Crypto/Cipher
......
......
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigVerPSS_186-3.rsp -> build/lib.linux-x86_64-3.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigGenPSS_186-2.txt -> build/lib.linux-x86_64-3.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running build_ext
Compiling support for Intel AES instructions
building 'Crypto.Hash._MD2' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DLTC_NO_ASM -DHAVE_CPUID_H -Isrc/ -I/usr/include/python3.7m -c src/MD2.c -o build/temp.linux-x86_64-3.7/src/MD2.o
gcc -pthread -shared -Wl,-z,relro -g build/temp.linux-x86_64-3.7/src/MD2.o -L/usr/lib64 -lpython3.7m -o build/lib.linux-x86_64-3.7/Crypto/Hash/_MD2.cpython-37m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lpython3.7m
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
So why actually the above error is encountered and whats the fix ?