# Certbot auto started failing with ' No module named pip.\_\_main\_\_'

**URL:** <https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097>\
**Category:** Help\
**Created:** [March 19, 2019, 10:25am UTC](https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097 "2019-03-19T10:25:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericb2038](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/ericb2038/32/30682_2.png) [@ericb2038](https://community.letsencrypt.org/u/ericb2038)\
**Post date:** [March 19, 2019, 10:25am UTC](https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097/1 "2019-03-19T10:25:16Z")

</div>

Hi,  
I’m running with a bit of a problem on one of my old servers.  
It’s an unbuntu 12.05 and it was never updated to a more recent release (and it actually needs to stay with that setup)

I run several domains on it and have been using certbot-auto for quite a while until recently I received emails about renewals that had not happened

I went to check, and apparently certbot-auto now fails when trying to create the virtual environment

I’m getting this error message: (sorry that system’s in french, 'est déjà la plus récente version disponible’n means is already the most recent version available.

```
augeas-lenses est déjà la plus récente version disponible.
gcc est déjà la plus récente version disponible.
libaugeas0 est déjà la plus récente version disponible.
libffi-dev est déjà la plus récente version disponible.
python-virtualenv est déjà la plus récente version disponible.
ca-certificates est déjà la plus récente version disponible.
libssl-dev est déjà la plus récente version disponible.
openssl est déjà la plus récente version disponible.
python est déjà la plus récente version disponible.
python-dev est déjà la plus récente version disponible.
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
Creating virtual environment...
    Installing Python packages...
    /opt/eff.org/certbot/venv/bin/python: No module named pip. __main__ ; 'pip' is a package and cannot be directly executed
    Traceback (most recent call last):
      File "/tmp/tmp.xwWeTUnj39/pipstrap.py", line 177, in <module>
        sys.exit(main())
      File "/tmp/tmp.xwWeTUnj39/pipstrap.py", line 149, in main
        pip_version = StrictVersion(check_output([python, '-m', 'pip', '--version'])
      File "/usr/lib/python2.7/subprocess.py", line 544, in check_output
        raise CalledProcessError(retcode, cmd, output=output)
    subprocess.CalledProcessError: Command '['/opt/eff.org/certbot/venv/bin/python', '-m', 'pip', '--version']' returned non-zero exit status 1

```

I Goggled and found similar problem, all related to python/pip, but none (as of yet) that could relate to this particular situation with certbot-auto

The python certbot-auto installed is 2.7.

I’m guessing it was a botched auto update (i’m running it on a nightly cron with):  
`/root/certbot-auto renew --standalone --pre-hook "service apache2 stop" --post-hook "service apache2 start"` and as it tries to self update before installing, it could have happened then…

Still some certificates are gonna be closing up real soon, and I need to renew those, so anybody got an idea (or a pointer towards a solution that i failed to find) of what might have happen and how to correct the situation , That’d be great help. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [March 19, 2019, 10:30am UTC](https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097/2 "2019-03-19T10:30:39Z")

</div>

Hi @ericb2038

> [@ericb2038](#):
>
> 'pip' is a package and cannot be directly executed

there are some threads with the same error message.

Check

> [@Python error when running certbot-auto](https://community.letsencrypt.org/t/python-error-when-running-certbot-auto/88399):
>
> H…

---

<div class="post-metadata">

**Author:** ![ericb2038](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/ericb2038/32/30682_2.png) [@ericb2038](https://community.letsencrypt.org/u/ericb2038)\
**Post date:** [March 19, 2019, 10:43am UTC](https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097/3 "2019-03-19T10:43:26Z")

</div>

Hi Juergenn Thank you so much, downgrading certbot-auto to 0.31 was indeed the solution 🙂

Here’s the link if someone stumbles on this post with the same problem

[https://github.com/certbot/certbot/issues/6824#issuecomment-470440436](https://github.com/certbot/certbot/issues/6824#issuecomment-470440436),

or the solution directly:

```auto
rm ./certbot-auto*
wget https://raw.githubusercontent.com/certbot/certbot/75499277be6699fd5a9b884837546391950a3ec9/certbot-auto
chmod +x ./certbot-auto
./certbot-auto --no-self-upgrade

```

---

<div class="post-metadata">

**Author:** ![ericb2038](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/ericb2038/32/30682_2.png) [@ericb2038](https://community.letsencrypt.org/u/ericb2038)\
**Post date:** [March 19, 2019, 11:10am UTC](https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097/4 "2019-03-19T11:10:34Z")

</div>

A little update, there is an original topic there:

> [@PIP error with certbot-auto](https://community.letsencrypt.org/t/pip-error-with-certbot-auto/88200):
>
> H…

This gives the solution above, and another one involving patching current version (0.32), to make it work as intended.

> [@PIP error with certbot-auto](https://community.letsencrypt.org/t/pip-error-with-certbot-auto/88200/6):
>
> I…

---

<div class="post-metadata">

**Author:** ![poolebu](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/poolebu/32/30922_2.png) [@poolebu](https://community.letsencrypt.org/u/poolebu)\
**Post date:** [April 1, 2019, 1:07pm UTC](https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097/5 "2019-04-01T13:07:07Z")

</div>

Thank you! , this really saved the day for us!

---

<div class="post-metadata">

**Author:** ![mmallejac](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mmallejac](https://community.letsencrypt.org/u/mmallejac)\
**Post date:** [April 23, 2019, 6:20am UTC](https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097/6 "2019-04-23T06:20:12Z")

</div>

Same thing here ! Worked like a charm and got us out of trouble. Thanks a lot

---

<div class="post-metadata">

**Author:** ![maxxer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/maxxer/32/15271_2.png) [@maxxer](https://community.letsencrypt.org/u/maxxer)\
**Post date:** [April 24, 2019, 3:37pm UTC](https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097/7 "2019-04-24T15:37:31Z")

</div>

does anybody knows if it’s possible to configure `--no-self-upgrade` _system-wide_ without passing the parameter all times? I’ve an installation of ISPConfig and I don’t know where cerbot is called from…

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [May 24, 2019, 3:37pm UTC](https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097/8 "2019-05-24T15:37:39Z")

</div>

Closed on May 24, 2019, 3:37pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
