I am using a third-party script named “letsencrypt-vesta” to automate the process of applying and renewing LE certificates on my VestaCP panel.
From the code of letsencrypt-vesta script, I can see that it uses certbot-auto command:
LETSENCRYPT_COMMAND=’/usr/local/certbot/certbot-auto -t --renew-by-default --agree-tos --webroot -w /etc/letsencrypt/webroot --server https://acme-v01.api.letsencrypt.org/directory’
Well, we know that Ubuntu Server 16.04.2 already installed both python 2.7 and python 3.5, while v2.7 is the default one. I can confirm this by running following command on my SSH client:
root@ubuntu:~# python -V
root@ubuntu:~# python3 -V
However, if I run letsencrypt-vesta script directly, it will end up with following error:
OSError: Command /opt/eff.org/certbot/venv/bin/python2.7 - setuptools pkg_resources pip wheel failed with error code 2
Let’s Encrypt returned an error status. Aborting.
The solution was introduced here:
That is , just remove python3 completely, then letsencrypt-vesta will work smoothly.
But, I have a different oppinion:
We know that, Certbot already supports python3 .
So, why we need to remove python 3 ? Why not just let certbot-auto command choose to use python3 instead?
Now, I final question is:
Can I specify the python version (python3) when running “certbot-auto” command?
How to let certbot-auto command choose to use python 3 when the system default python version is 2.7?