New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./letsencrypt-auto: line 460: virtualenv: command not found #2889

Closed
gitcnd opened this Issue Apr 24, 2016 · 24 comments

Comments

Projects
None yet
@gitcnd

gitcnd commented Apr 24, 2016

does not work on centos

@anthonyiops

This comment has been minimized.

anthonyiops commented Apr 26, 2016

Try adding the EPEL repository first:

yum install epel-release
@ghost

This comment has been minimized.

ghost commented May 23, 2016

Having same issues on Ubuntu 14.04 lts.

@bmw

This comment has been minimized.

Contributor

bmw commented May 23, 2016

@gitcnd, did installing epel-release fix the problem?

@chearful, the conversation on #2870 might be useful to you.

@bmw

This comment has been minimized.

Contributor

bmw commented Jun 2, 2016

I believe this issue can be closed. If anyone disagrees, just comment and let me know.

@bmw bmw closed this Jun 2, 2016

@aronduby

This comment has been minimized.

aronduby commented Jun 19, 2016

Unfortunately I'm running into the same issue. It looks like I have the latest epel-release

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.chi.host-engine.com
 * extras: centos.chi.host-engine.com
 * updates: mirrors.usinternet.com
 * webtatic: us-east.repo.webtatic.com
Setting up Install Process
Package epel-release-6-8.noarch already installed and latest version
Nothing to do

but I'm missing python-pip and python-virualenv, see output from the plugins command (or any command apparently)

Bootstrapping dependencies for RedHat-based OSes...
yum is /usr/bin/yum
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.chi.host-engine.com
 * extras: centos.chi.host-engine.com
 * updates: mirrors.usinternet.com
 * webtatic: us-east.repo.webtatic.com
Package gcc-4.4.7-17.el6.x86_64 already installed and latest version
Package dialog-1.1-9.20080819.1.el6.x86_64 already installed and latest version
Package augeas-libs-1.0.0-10.el6.x86_64 already installed and latest version
Package openssl-1.0.1e-48.el6_8.1.x86_64 already installed and latest version
Package openssl-devel-1.0.1e-48.el6_8.1.x86_64 already installed and latest version
Package libffi-devel-3.0.5-3.2.el6.x86_64 already installed and latest version
Package redhat-rpm-config-9.0.3-51.el6.centos.noarch already installed and latest version
Package ca-certificates-2015.2.6-65.0.1.el6_7.noarch already installed and latest version
Package python-2.6.6-64.el6.x86_64 already installed and latest version
Package python-devel-2.6.6-64.el6.x86_64 already installed and latest version
No package python-virtualenv available.
Package python-tools-2.6.6-64.el6.x86_64 already installed and latest version
No package python-pip available.
Package 1:mod_ssl-2.2.15-53.el6.centos.x86_64 already installed and latest version
Nothing to do
Creating virtual environment...
/usr/local/bin/certbot-auto: line 558: virtualenv: command not found

So I thought I'll just manually install pip, but when I try yum install python-pip I get no package found.

Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.chi.host-engine.com
 * extras: centos.chi.host-engine.com
 * updates: mirrors.usinternet.com
 * webtatic: us-east.repo.webtatic.com
No package python-pip available.
Error: Nothing to do
@aronduby

This comment has been minimized.

aronduby commented Jun 19, 2016

I ended up going through and manually installing pip and virtualenv and it's working with deprecation warnings about it being python 2.6. I installed 2.7, but had to do it as python2.7 since apparently yum requires 2.6. But I don't know how to get the script to run with 2.7.

@bmw bmw reopened this Jun 21, 2016

@bmw

This comment has been minimized.

Contributor

bmw commented Jun 21, 2016

@aronduby, thanks for reporting the issue. A few questions:

  1. Just to clarify, what OS are you using? Looks like CentOS 6.
  2. What is the output of yum info python-virtualenv and yum info python-pip?

Also, the deprecation warning is output by one of our dependencies, however, we've pin specific versions of their packages in certbot-auto and we don't plan to drop support for Python 2.6 anytime soon. As for using Certbot with Python 2.7, certbot-auto prefers python binaries in this order:

python2.7 python27 python2 python

If one of those binaries corresponds with Python 2.7 and appears in the list before the Python 2.6 binary, deleting the virtual environment with rm -rf ${XDG_DATA_HOME:-~/.local/share}/letsencrypt and rerunning certbot-auto should install the client using Python 2.7.

@aronduby

This comment has been minimized.

aronduby commented Jun 29, 2016

@bmw you are correct, it's CentOS 6. Both virtualenv and pip end with an error saying no macthing packages

yum info python-virtualenv
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: centos.chicago.waneq.com
 * extras: mirror.oss.ou.edu
 * updates: mirror.nexcess.net
 * webtatic: us-east.repo.webtatic.com
base                                                                                  | 3.7 kB     00:00
centos-sclo-rh                                                                        | 2.9 kB     00:00
extras                                                                                | 3.4 kB     00:00
newrelic                                                                              |  951 B     00:00
tor                                                                                   | 2.9 kB     00:00
tor-source                                                                            | 2.9 kB     00:00
updates                                                                               | 3.4 kB     00:00
updates/primary_db                                                                    | 748 kB     00:00
vz-base                                                                               |  951 B     00:00
vz-updates                                                                            |  951 B     00:00
webtatic                                                                              | 3.6 kB     00:00
Error: No matching Packages to list

and

yum info python-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.chicago.waneq.com
 * extras: mirror.oss.ou.edu
 * updates: mirror.nexcess.net
 * webtatic: us-east.repo.webtatic.com
Error: No matching Packages to list

I'll dig into the env later tonight and report back. If nothing else it's good to know that you've pinned the version.

@chopstik

This comment has been minimized.

chopstik commented Jul 24, 2016

Similar position here @bmw I've Centos 6 with both Python 2.6 and 2.7 installed. ./certbot-auto is not picking up that python2.7 is available and is trying to install python-tools 2.6.6-64.el6 which is a conflict.
Followed your advice above namely, rm -rf ${XDG_DATA_HOME:-~/.local/share}/letsencrypt and ran./certbot-auto but certbot is still looking to install...

Package python-tools.i686 0:2.6.6-64.el6 will be installed

I also get the following for yum info python-virtualenv and yum info python-pip

Error: No matching Packages to list

@bmw

This comment has been minimized.

Contributor

bmw commented Jul 25, 2016

@chopstik, and you have epel-release installed?

@Maikel-Predikkta

This comment has been minimized.

Maikel-Predikkta commented Jul 26, 2016

I'm using Amazon Linux and ran certbot-auto --debug. It installed a bunch of dependencies (python27) and then failed on:

Creating virtual environment...
/root/bin/certbot-auto: line 558: virtualenv: command not found

I then found this issue. ${XDG_DATA_HOME:-~/.local/share} does not exist. I added the epel repository, but re-running certbot-auto does not try to install anything else.

Running yum install python-devel python-pip python-tools python-virtualenv installs python26 packages and certbot-auto --debug successfully finishes with:

No installers are available on your OS yet; try running "letsencrypt-auto certonly" to get a cert you can install manually
@chopstik

This comment has been minimized.

chopstik commented Jul 26, 2016

@bmw yum info epel-release telling me the repo is installed, yes.

@chopstik

This comment has been minimized.

chopstik commented Aug 2, 2016

@bmw any further ideas on this, python-tools is used by WHM etc to update the system and I'm stuck now without it. Any ideas appreciated.

@bmw

This comment has been minimized.

Contributor

bmw commented Aug 10, 2016

@chopstik, you should probably create a new issue because certbot-auto preferring Python 2.6 over Python 2.7 is very different from the problem reported in this thread. The relevant code is here which I suspect is causing your problem. We could potentially look into flipping that logic (checking for python27 first), but that's used by all RPM systems and we would have to investigate any impact such a change may have.

As a workaround, you can make such a patch to your local copy of certbot-auto.

@djanowski

This comment has been minimized.

djanowski commented Sep 6, 2016

yum remove python27-virtualenv and re-running certbot-auto worked for me.

@micron

This comment has been minimized.

micron commented Sep 7, 2016

If you're using Amazon Linux with Python 2.6 and have pip already installed, just run
pip install virtualenv to install the virtualenv package.

I had the same problem like @Maikel-Predikkta but i was not able to install python-virtualenv through yum.

@frankydp

This comment has been minimized.

frankydp commented Sep 16, 2016

yum install python-pip
pip install virtualenv

worked for me with warnings on version conflict for 2.6,
27 python-pip along with virtualenv was installed by certbot but was available to the script.

Amazon Linux 2016.03

@Hokkaidosunny

This comment has been minimized.

Hokkaidosunny commented Feb 8, 2017

yum install python-setuptools python-setuptools-devel
easy_install pip
pip install virtualenv

worked for me(python 2.6 ,centos 6)

@bigicoin

This comment has been minimized.

bigicoin commented Mar 14, 2017

@Hokkaidosunny 's fix worked great. Thank you.

One note -- to use sudo for pip install, you must do whereis pip and use sudo with the full path to pip, or else it doesn't find it.

@rrmerugu

This comment has been minimized.

rrmerugu commented Mar 16, 2017

sudo ln -s /usr/local/bin/virtualenv /usr/bin/virtualenv this worked for me

@alphahamster

This comment has been minimized.

alphahamster commented Apr 4, 2017

@Hokkaidosunny Also worked like a charm for me! Thank you so much!

Working on Amazon Linux Ami and Nginx

@tamanti

This comment has been minimized.

tamanti commented Sep 25, 2017

On Amazon Linux Ami, if phyton 2.6 is already installed, installing python 2.7 doesn't make it the default one.
I had to change: /etc/alternatives/python -> /usr/bin/python2.6
to
/etc/alternatives/python -> /usr/bin/python2.7

@swoodford

This comment has been minimized.

swoodford commented Sep 26, 2017

I've renewed this same certificate on the same server many times before. It's running Apache 2.4 on Amazon Linux AMI release 2017.03.

Well today for no reason at all the usual renewal command no longer works:

[ec2-user@www ~]$ sudo /home/ec2-user/certbot-auto renew --debug
Creating virtual environment...
/home/ec2-user/certbot-auto: line 864: virtualenv: command not found

I tried everything suggested in this issue thread and others, nothing worked, until I tried this one thing that no one else suggested:
sudo yum remove python27-virtualenv

followed by:
sudo yum install python27-virtualenv

[ec2-user@www bin]$ sudo /home/ec2-user/certbot-auto renew --debug
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Saving debug log to /var/log/letsencrypt/letsencrypt.log

-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/www.domain.com.conf
-------------------------------------------------------------------------------
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate
...

Boom, working now. WTF?

@sydneyli

This comment has been minimized.

Member

sydneyli commented Nov 14, 2018

This thread is a collection of different issues across various OS's. There's not anything in particular in common that's actionable on our side, so I'm closing this issue.

If you stumble on this issue with something similar, try asking the Let's Encrypt Community Forums! You'll get faster help there; if it turns out that from your forum discussion you find something we can fix in this repository, feel free to open a new issue.

@sydneyli sydneyli closed this Nov 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment