python执行提示“ImportError: No module named OpenSSL.crypto”

时间:2023-01-11 15:31:55

错误信息如下:

Traceback (most recent call last):
  File "/usr/local/yunanbao/yxz-script/autoops/TaskServer.py", line 11, in <module>
    from TaskHandler import TaskHandler
  File "/usr/local/yunanbao/yxz-script/autoops/TaskHandler.py", line 17, in <module>
    from TaskPlayer import TaskPlayer
  File "/usr/local/yunanbao/yxz-script/autoops/TaskPlayer.py", line 17, in <module>
    from OpenSSL.crypto import FILETYPE_PEM, load_privatekey, dump_privatekey
ImportError: No module named OpenSSL.crypto

解决:安装pyOpenSSL的软件包

[root@bbee65a673d5 ~]# yum install -y pyOpenSSL