# ContextualVersionConflict: urllib3 1.23

**URL:** <https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756>\
**Category:** Help\
**Created:** [June 6, 2018, 6:36am UTC](https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756 "2018-06-06T06:36:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jurgenhaas](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jurgenhaas/32/2609_2.png) [@jurgenhaas](https://community.letsencrypt.org/u/jurgenhaas)\
**Post date:** [June 6, 2018, 6:36am UTC](https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756/1 "2018-06-06T06:36:53Z")

</div>

I’m using certbot 0.22.2-1+ubuntu16.04.1+certbot+1 on Ubuntu 16.04 and since the Python lib urllib3 got upgraded to version 1.23 yesterday, certbot won’t work anymore because of a version requirement conflict. It is bound to urllib3\<1.23,\>=1.21.1

The full stack trace looks like this:

```auto
2018-06-06 06:25:45,934:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
  File "/usr/local/bin/certbot", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/certbot/main.py", line 1289, in main
    plugins = plugins_disco.PluginsRegistry.find_all()
  File "/usr/local/lib/python2.7/dist-packages/certbot/plugins/disco.py", line 200, in find_all
    plugin_ep = PluginEntryPoint(entry_point)
  File "/usr/local/lib/python2.7/dist-packages/certbot/plugins/disco.py", line 46, in __init__
    self.plugin_cls = entry_point.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/ __init__.py", line 2317, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/ __init__.py", line 2340, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/ __init__.py", line 779, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
ContextualVersionConflict: (urllib3 1.23 (/usr/local/lib/python2.7/dist-packages), Requirement.parse('urllib3<1.23,>=1.21.1'), set(['requests']))
2018-06-06 06:25:45,934:ERROR:certbot.log:An unexpected error occurred:

```

Is there a way around this or could certbot lift their version requirements?

---

<div class="post-metadata">

**Author:** ![\_az](https://avatars.discourse-cdn.com/v4/letter/_/22d042/32.png) [@\_az](https://community.letsencrypt.org/u/_az)\
**Post date:** [June 6, 2018, 6:46am UTC](https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756/2 "2018-06-06T06:46:10Z")

</div>

> [@jurgenhaas](#):
>
> Python lib urllib3 got upgraded to version 1.23 yesterday

From where?

I can only see 1.13-1-2 in Xenial, and 1.21.1-1 provided from the Certbot PPA.

You can try use `certbot-auto`, it runs in venv, isolated from your system's libraries. (At least, until Certbot loosens that version constraint).

---

<div class="post-metadata">

**Author:** ![mnordhoff](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mnordhoff/32/22583_2.png) [@mnordhoff](https://community.letsencrypt.org/u/mnordhoff)\
**Post date:** [June 6, 2018, 6:59am UTC](https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756/3 "2018-06-06T06:59:39Z")

</div>

> [@jurgenhaas](#):
>
> certbot 0.22.2-1+ubuntu16.04.1+certbot+1

> [@jurgenhaas](#):
>
> File "/usr/local/bin/certbot", line 11, in \<module\>

> [@jurgenhaas](#):
>
> File "/usr/local/lib/python2.7/dist-packages/certbot/main.py", line 1289, in main

The Certbot packages from the PPA are installed in `/usr`, not `/usr/local`. (And they use Python 3 now.) The `/usr/local` Certbot must be something separate, maybe installed with `pip`.

---

<div class="post-metadata">

**Author:** ![jurgenhaas](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jurgenhaas/32/2609_2.png) [@jurgenhaas](https://community.letsencrypt.org/u/jurgenhaas)\
**Post date:** [June 6, 2018, 8:45am UTC](https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756/4 "2018-06-06T08:45:05Z")

</div>

That’s interesting. I may have installed certbot with PIP originally but I also installed it again later with `apt install certbot` which just now confirms `certbot is already the newest version (0.22.2-1+ubuntu16.04.1+certbot+1)`. But when I remove the certbot executable from /`usr/local/bin` there is no other one that could be found.

I then searched the entire system for `certbot` and found Python 2 packages installed at `/usr/local/lib/python2.7/dist-packages/certbot` and Python3 packages installed at `/usr/lib/python3/dist-packages/certbot`

As the OS defaults to Python 2 still - sorry for that 😉 - it executes the “wrong” one. By changing the shebang in `/usr/local/bin/certbot` to `#!/usr/bin/python3` I was now able to force usage of Python 3.

OK, I will be uninstalling the Python 2 packages. But how would one on Ubuntu get certbot to launch if the only available executable lives in `/usr/local/bin` and is configured to `/usr/bin/python` which may well default to Python 2 on a lot of systems?

---

<div class="post-metadata">

**Author:** ![mnordhoff](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mnordhoff/32/22583_2.png) [@mnordhoff](https://community.letsencrypt.org/u/mnordhoff)\
**Post date:** [June 6, 2018, 8:47am UTC](https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756/5 "2018-06-06T08:47:33Z")

</div>

`/usr/bin/certbot` should already exist and use Python 3.

---

<div class="post-metadata">

**Author:** ![jurgenhaas](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jurgenhaas/32/2609_2.png) [@jurgenhaas](https://community.letsencrypt.org/u/jurgenhaas)\
**Post date:** [June 6, 2018, 8:51am UTC](https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756/6 "2018-06-06T08:51:42Z")

</div>

It’s not. And I checked several dozen hosts for it.

---

<div class="post-metadata">

**Author:** ![mnordhoff](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mnordhoff/32/22583_2.png) [@mnordhoff](https://community.letsencrypt.org/u/mnordhoff)\
**Post date:** [June 6, 2018, 9:22am UTC](https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756/7 "2018-06-06T09:22:26Z")

</div>

It’s part of the `certbot` package. It can’t not exist unless the package is not installed or the file has been deleted.

---

<div class="post-metadata">

**Author:** ![jurgenhaas](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jurgenhaas/32/2609_2.png) [@jurgenhaas](https://community.letsencrypt.org/u/jurgenhaas)\
**Post date:** [June 6, 2018, 9:30am UTC](https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756/8 "2018-06-06T09:30:29Z")

</div>

Very interesting. All my hosts are deployed with Ansible and here is the playbook that installs Certbot:

```auto
---
# file: roles/letsencrypt/tasks/install.yml

- name: "Apt Key"
  apt_key:
    url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x8C47BE8E75BCA694'
    state: 'present'

- name: "Apt Repository"
  apt_repository:
    repo: 'ppa:certbot/certbot'
    state: 'present'
    mode: '644'

- name: "Install CertBot"
  apt:
    pkg: 'certbot'
    state: 'present'
    update_cache: yes

```

Couldn’t get any simpler and that’s all that happens.

---

<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:** [July 6, 2018, 9:30am UTC](https://community.letsencrypt.org/t/contextualversionconflict-urllib3-1-23/63756/9 "2018-07-06T09:30:30Z")

</div>

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