当在AWS上使用let's encrypt 申请免费证书时出现OSError的解决方法

在AWS上使用 let's encrypt 申请免费证书时,当使用如下命令时:

[root@AWS certbot-master]# ./certbot-auto --debug

出现如下的报错:

[root@AWS certbot-master]# ./certbot-auto --debug

Bootstrapping dependencies for Amazon... (you can skip this with --no-bootstrap)

yum is /usr/bin/yum

yum is hashed (/usr/bin/yum)

Loaded plugins: priorities, update-motd, upgrade-helper

amzn-main                                                                             | 2.1 kB  00:00:00     
amzn-updates                                                                          | 2.5 kB  00:00:00     
epel/x86_64/metalink                                                                  | 5.3 kB  00:00:00     
epel                                                                                  | 3.2 kB  00:00:00     
(1/2): epel/x86_64/updateinfo                                                         | 785 kB  00:00:00     
(2/2): epel/x86_64/primary                                                            | 3.2 MB  00:00:01     
epel                                                                                             12517/12517
1045 packages excluded due to repository priority protections

Package gcc-4.8.5-1.22.amzn1.noarch already installed and latest version

Package augeas-libs-1.0.0-5.7.amzn1.x86_64 already installed and latest version

Package 1:openssl-1.0.2k-8.106.amzn1.x86_64 already installed and latest version

Package 1:openssl-devel-1.0.2k-8.106.amzn1.x86_64 already installed and latest version

Package libffi-devel-3.0.13-16.5.amzn1.x86_64 already installed and latest version

Package system-rpm-config-9.0.3-42.28.amzn1.noarch already installed and latest version

Package ca-certificates-2015.2.6-65.0.1.16.amzn1.noarch already installed and latest version

Package python27-devel-2.7.13-2.122.amzn1.x86_64 already installed and latest version

Package python27-virtualenv-15.1.0-1.14.amzn1.noarch already installed and latest version

Package python27-tools-2.7.13-2.122.amzn1.x86_64 already installed and latest version

Package python27-pip-9.0.1-1.24.amzn1.noarch already installed and latest version

Package 1:mod_ssl-2.2.34-1.16.amzn1.x86_64 already installed and latest version

Nothing to do

Creating virtual environment...

Traceback (most recent call last):

  File "/usr/bin/virtualenv", line 11, in 
    load_entry_point('virtualenv==15.1.0', 'console_scripts', 'virtualenv')()

  File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 713, in main
    symlink=options.symlink)

  File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 945, in create_environment
    download=download,

  File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 901, in install_wheel call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)

  File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 797, in call_subprocess % (cmd_desc, proc.returncode))

OSError: Command /opt/eff.org/certbot/venv/bin/python2.7 - setuptools pip wheel failed with error code 2

The OS version of AWS is this:

[root@AWS certbot-master]# cat /etc/issue

Amazon Linux AMI release 2017.09
Kernel \r on an \m

You have new mail in /var/spool/mail/ec2-user

[root@AWS certbot-master]# uname -a

Linux ip-10-0-2-87 4.9.85-38.58.amzn1.x86_64 #1 SMP Wed Mar 14 01:17:26 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

解决的方法是:

卸载virtualenv: pip  uninstall  virtualenv

再安装virtualenv : pip  install  virtualenv==15.1.0

原因是virtualenv的版本问题。

你可能感兴趣的:(当在AWS上使用let's encrypt 申请免费证书时出现OSError的解决方法)