pkg_resources.ContextualVersionConflict: urllib3 2.0.3

I am unable to run certbot after running brew install certbot

My domain is:
equinox.com

I ran this command:
brew install certbot
certbot -v

It produced this output:

An unexpected error occurred:
pkg_resources.ContextualVersionConflict: (urllib3 2.0.3 (/usr/local/Cellar/certbot/2.6.0_1/libexec/lib/python3.11/site-packages), Requirement.parse('urllib3<1.27,>=1.25.4'), {'botocore'})
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/folders/gp/b7z3rfpn4v75bs_xkg4xzpj5ysczwg/T/certbot-log-6orjt2ey/log or re-run Certbot with -v for more details.

My web server is (include version):
I am not using certbot to install the certificate on a web server - just to renew a certificate locally.

The operating system my web server runs on is (include version):
macOS Ventura 13.5.2

I can login to a root shell on my machine (yes or no, or I don't know):
yes

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):
certbot brew install output:

brew install certbot
==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################################################################################################################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/certbot/manifests/2.6.0_1-3
Already downloaded: /Users/awerderman/Library/Caches/Homebrew/downloads/1dfb57e5521dbd81a4471b35b94a1bc0ecd7d858e754399ad79243058a1c5eec--certbot-2.6.0_1-3.bottle_manifest.json
==> Fetching certbot
==> Downloading https://ghcr.io/v2/homebrew/core/certbot/blobs/sha256:d7f056e3bb0385653713c127931f85c02f352ce0a810c4183e7c814f4a58b599
Already downloaded: /Users/awerderman/Library/Caches/Homebrew/downloads/3c576cf8f011f8bfdc971e8ee3efc212e746bc0ce859c7cea434fe5539731b0c--certbot--2.6.0_1.ventura.bottle.3.tar.gz
==> Pouring certbot--2.6.0_1.ventura.bottle.3.tar.gz
🍺  /usr/local/Cellar/certbot/2.6.0_1: 760 files, 5MB
==> Running `brew cleanup certbot`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

The error is from the Python package botocore which is a dependency of the certbot-dns-route53 plugin. Maybe it would suffice to reinstall that plugin (assuming you're using it), otherwise I'm enclined to say you'd need to file this issue at the Homebrew people.

3 Likes

I missed that the certbot-dns-route53 plugin is being managed by Pip while Certbot is managed by Homebrew. Upgrading the plugin worked. Thank you!

Edit: even with upgrading everything, I had to make sure urllib3 is set at 1.26.16. Note this error message:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
botocore 1.31.45 requires urllib3<1.27,>=1.25.4, but you have urllib3 2.0.4 which is incompatible.
4 Likes

And with "upgrading", just for the record, I hope you mean uninstalled using pip and reinstalled using Homebrew?

2 Likes

I didn't know that was an option for these extended plugins. From what I've seen, that isn't an option right now.

Oh, that's a bummer.

Because using pip to install packages globally is a recipe for disaster with conflicting dependencies all around..

Ah well, at least you know where to look in the future :slight_smile:

That Github issue does mention some good ways to install the plugins into the Certbot venv made by Homebrew though. That would I guess be the "best next thing" compared to installing the plugin globally.

3 Likes

Or, maybe use an ACME Client that is not based on python?

Would a BASH client work? If so, acme.sh is popular

5 Likes

My use case is a one-off. 99% of the time I am using certbot in a container, but ran into this issue locally. Those are all good suggestions though. I appreciate the quick help!

5 Likes

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