无法安装简单加密

cannot install simple-crypt

我正在尝试安装 python“simple-crypt”包。

我收到这些错误:

  warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
  building 'Crypto.Hash._MD2' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/src
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -fwrapv -Wall -fstack-protector-strong -Wformat -Werror=format-security -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python3.8 -c src/MD2.c -o build/temp.linux-x86_64-3.8/src/MD2.o
  src/MD2.c:31:10: fatal error: Python.h: No such file or directory
   #include "Python.h"
            ^~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pycrypto
  Running setup.py clean for pycrypto
Failed to build pycrypto
Installing collected packages: pycrypto, simple-crypt
  Running setup.py install for pycrypto ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-p3xxymfk/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 /tmp/pip-o50gn6p7-record/install-record.txt --single-version-externally-managed --compile:
    warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
    building 'Crypto.Hash._MD2' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/src
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -fwrapv -Wall -fstack-protector-strong -Wformat -Werror=format-security -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python3.8 -c src/MD2.c -o build/temp.linux-x86_64-3.8/src/MD2.o
    src/MD2.c:31:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-p3xxymfk/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 /tmp/pip-o50gn6p7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-p3xxymfk/pycrypto/

我需要一个与我的 python 版本匹配的 python-dev。

我有 python 3.8.5,所以: apt-get install python3.8-dev

现在我可以毫无错误地安装 simple-crypt。