标题如果直接安装的话,pycharm引用肯定是不会报红的,但是运行起来就直接报红了,所以,说明该库有问题,卸载该库,安装pycryptodome,如下: pip uninstall Crypto pip uninstall pycrypto pip install pycryptodome