pkg_resources.UnknownExtra: requests 2.6.0 has no such extra feature 'security'

My domain is:

west1.virtualairwaves.com

I ran this command:

sudo certbot --nginx

It produced this output:

Traceback (most recent call last):
  File "/usr/bin/certbot", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3105, in <module>
    @_call_aside
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3089, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3118, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 578, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 895, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 789, in resolve
    new_requirements = dist.requires(req.extras)[::-1]
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2622, in requires
    "%s has no such extra feature %r" % (self, ext)
pkg_resources.UnknownExtra: requests 2.6.0 has no such extra feature 'security'

My web server is (include version):

nginx/1.12.2

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

Linux ip-10-1-10-10.us-west-1.compute.internal 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

My hosting provider, if applicable, is:

aws

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

Yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):

no

I’ve used this command many times before and it works. This is a fresh instance of Centos 7 we brought up with a salt script. It should have the latest versions of everything; it was brought up from wholecloth a few hours ago. A very similar instance brought up with the same salt state configuration (but may have older versions of some packages because of this) works fine.

The “requests” package that’s missing the “extra feature” security was installed as a result of the install of python2-certbot-nginx

[centos@ip-10-1-10-10 ~]$ sudo yum install python2-certbot-nginx
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.scalabledns.com
 * epel: s3-mirror-us-west-1.fedoraproject.org
 * extras: repos.lax.quadranet.com
 * updates: mirror.scalabledns.com
Resolving Dependencies
--> Running transaction check
---> Package python2-certbot-nginx.noarch 0:0.26.1-1.el7 will be installed
--> Processing Dependency: python2-certbot >= 0.22.0 for package: python2-certbot-nginx-0.26.1-1.el7.noarch
--> Processing Dependency: python2-acme >= 0.25.0 for package: python2-certbot-nginx-0.26.1-1.el7.noarch
--> Processing Dependency: certbot >= 0.22.0 for package: python2-certbot-nginx-0.26.1-1.el7.noarch
--> Running transaction check
---> Package certbot.noarch 0:0.27.1-1.el7 will be installed
---> Package python2-acme.noarch 0:0.26.1-1.el7 will be installed
--> Processing Dependency: python2-requests for package: python2-acme-0.26.1-1.el7.noarch
---> Package python2-certbot.noarch 0:0.27.1-1.el7 will be installed
--> Running transaction check
---> Package python2-requests.noarch 0:2.6.0-0.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================ Package                             Arch                 Version                      Repository          Size ================================================================================================================Installing:
 python2-certbot-nginx               noarch               0.26.1-1.el7                 epel                67 k Installing for dependencies:
 certbot                             noarch               0.27.1-1.el7                 epel                21 k  python2-acme                        noarch               0.26.1-1.el7                 epel               140 k  python2-certbot                     noarch               0.27.1-1.el7                 epel               519 k  python2-requests                    noarch               2.6.0-0.el7                  epel               2.9 k

Transaction Summary
================================================================================================================Install  1 Package (+4 Dependent packages)

Total download size: 750 k
Installed size: 3.3 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): certbot-0.27.1-1.el7.noarch.rpm                                                   |  21 kB  00:00:00
(2/5): python2-acme-0.26.1-1.el7.noarch.rpm                                              | 140 kB  00:00:00
(3/5): python2-certbot-0.27.1-1.el7.noarch.rpm                                           | 519 kB  00:00:00
(4/5): python2-certbot-nginx-0.26.1-1.el7.noarch.rpm                                     |  67 kB  00:00:00
(5/5): python2-requests-2.6.0-0.el7.noarch.rpm                                           | 2.9 kB  00:00:00
----------------------------------------------------------------------------------------------------------------Total                                                                           1.1 MB/s | 750 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : python2-requests-2.6.0-0.el7.noarch                                                          1/5
  Installing : python2-acme-0.26.1-1.el7.noarch                                                             2/5
  Installing : python2-certbot-0.27.1-1.el7.noarch                                                          3/5
  Installing : certbot-0.27.1-1.el7.noarch                                                                  4/5
  Installing : python2-certbot-nginx-0.26.1-1.el7.noarch                                                    5/5
  Verifying  : python2-certbot-nginx-0.26.1-1.el7.noarch                                                    1/5
  Verifying  : python2-requests-2.6.0-0.el7.noarch                                                          2/5
  Verifying  : certbot-0.27.1-1.el7.noarch                                                                  3/5
  Verifying  : python2-certbot-0.27.1-1.el7.noarch                                                          4/5
  Verifying  : python2-acme-0.26.1-1.el7.noarch                                                             5/5

Installed:
  python2-certbot-nginx.noarch 0:0.26.1-1.el7

Dependency Installed:
  certbot.noarch 0:0.27.1-1.el7                          python2-acme.noarch 0:0.26.1-1.el7
  python2-certbot.noarch 0:0.27.1-1.el7                  python2-requests.noarch 0:2.6.0-0.el7

Complete!
[centos@ip-10-1-10-10 ~]$ sudo certbot --nginx
Traceback (most recent call last):
  File "/usr/bin/certbot", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3105, in <module>
    @_call_aside
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3089, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3118, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 578, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 895, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 789, in resolve
    new_requirements = dist.requires(req.extras)[::-1]
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2622, in requires
    "%s has no such extra feature %r" % (self, ext)
pkg_resources.UnknownExtra: requests 2.6.0 has no such extra feature 'security'

I tried installing the “extra” package like this:

[centos@ip-10-1-10-10 ~]$ sudo pip install requests[security]
Requirement already satisfied: requests[security] in /usr/lib/python2.7/site-packages (2.6.0)
requests 2.6.0 does not provide the extra 'security'

It’s odd that it says it’s already satisfied and that it doesn’t provide it. It’s almost like it’s built-in now, and explicitly requesting it is causing the error.

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