You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在AWS EC2上获取AWS Systems Manager参数时遇cryptography缺失错误的解决方法

解决AWS EC2执行aws ssm get-parameter时的No module named 'cryptography'错误

这个错误是由于AWS CLI依赖的cryptography Python模块缺失导致的,根据EC2实例的操作系统,可按以下步骤修复:

Amazon Linux 2 / Amazon Linux 2023

  • 更新系统包索引:
    sudo yum update -y
    
  • 安装cryptography模块(二选一即可):
    • 通过系统包管理器安装:
      sudo yum install python3-cryptography -y
      
    • 通过pip安装:
      sudo pip3 install cryptography
      

Ubuntu / Debian 系列

  • 更新系统包索引:
    sudo apt update -y
    
  • 安装cryptography模块(二选一即可):
    • 通过系统包管理器安装:
      sudo apt install python3-cryptography -y
      
    • 通过pip安装:
      sudo pip3 install cryptography
      

RHEL / CentOS 7/8

  • 更新系统包索引:
    sudo yum update -y
    
  • 安装cryptography模块(二选一即可):
    • 通过系统包管理器安装:
      sudo yum install python3-cryptography -y
      
    • 通过pip安装:
      sudo pip3 install cryptography
      

额外提示

如果执行pip安装时提示版本过低,先升级pip再安装:

sudo pip3 install --upgrade pip
sudo pip3 install cryptography

内容的提问来源于stack exchange,提问作者DmcZx

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 10:09:53