AttributeError: module 'enum' has no attribute 'IntFlag'

Hey!

Does anyone have any idea how to get rid of the enum module error? I have tried with python 2.7, 3.4, 3.6 with --no-self-upgrade and --no-bootstrap and it just doesn’t work, it keeps trying to install python packages and fails.

I’m using latest certbot and CentOS 6.5

Here’s my error:

Bootstrapping dependencies for RedHat-based OSes that will use Python3… (you can skip this with --no-bootstrap)
yum is /usr/bin/yum
yum is hashed (/usr/bin/yum)
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile

  • base: ftp.plusline.de
  • epel: mirror.imt-systems.com
  • extras: ftp.plusline.de
  • updates: ftp.plusline.de
    Package gcc-4.4.7-18.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-57.el6.x86_64 already installed and latest version
    Package openssl-devel-1.0.1e-57.el6.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-2017.2.14-65.0.1.el6_9.noarch already installed and latest version
    Package python34-3.4.5-4.el6.x86_64 already installed and latest version
    Package python34-devel-3.4.5-4.el6.x86_64 already installed and latest version
    Package python34-tools-3.4.5-4.el6.x86_64 already installed and latest version
    Package 1:mod_ssl-2.2.15-60.el6.centos.6.x86_64 already installed and latest version
    Nothing to do
    Creating virtual environment…
    Installing Python packages…
    Had a problem while installing Python packages.

pip prints the following errors:

Collecting argparse==1.4.0 (from -r /tmp/tmp.e43nYIAeJ7/letsencrypt-auto-requirements.txt (line 11))
Downloading argparse-1.4.0-py2.py3-none-any.whl
Collecting pycparser==2.14 (from -r /tmp/tmp.e43nYIAeJ7/letsencrypt-auto-requirements.txt (line 17))
Downloading pycparser-2.14.tar.gz (223kB)
Collecting asn1crypto==0.22.0 (from -r /tmp/tmp.e43nYIAeJ7/letsencrypt-auto-requirements.txt (line 21))
Downloading asn1crypto-0.22.0-py2.py3-none-any.whl (97kB)
Collecting cffi==1.10.0 (from -r /tmp/tmp.e43nYIAeJ7/letsencrypt-auto-requirements.txt (line 24))
Downloading cffi-1.10.0-cp36-cp36m-manylinux1_x86_64.whl (406kB)
Collecting ConfigArgParse==0.12.0 (from -r /tmp/tmp.e43nYIAeJ7/letsencrypt-auto-requirements.txt (line 61))
Downloading ConfigArgParse-0.12.0.tar.gz (41kB)
Collecting configobj==5.0.6 (from -r /tmp/tmp.e43nYIAeJ7/letsencrypt-auto-requirements.txt (line 63))
Downloading configobj-5.0.6.tar.gz
Collecting cryptography==2.0.2 (from -r /tmp/tmp.e43nYIAeJ7/letsencrypt-auto-requirements.txt (line 65))
Downloading cryptography-2.0.2-cp36-cp36m-manylinux1_x86_64.whl (2.2MB)
Collecting enum34==1.1.2 (from -r /tmp/tmp.e43nYIAeJ7/letsencrypt-auto-requirements.txt (line 96))
Downloading enum34-1.1.2.tar.gz (46kB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/opt/eff.org/certbot/venv/lib/python3.6/site-packages/setuptools/init.py”, line 5, in
import distutils.core
File “/usr/local/lib/python3.6/distutils/core.py”, line 16, in
from distutils.dist import Distribution
File “/usr/local/lib/python3.6/distutils/dist.py”, line 9, in
import re
File “/usr/local/lib/python3.6/re.py”, line 142, in
class RegexFlag(enum.IntFlag):
AttributeError: module ‘enum’ has no attribute ‘IntFlag’

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-kbkt4gmn/enum34/

Certbot has problem setting up the virtual environment.

We were not be able to guess the right solution from your pip
output.

Consult https://certbot.eff.org/docs/install.html#problems-with-python-virtual-environment
for possible solutions.
You may also find some support resources at https://certbot.eff.org/support/ .

So, I decided to comment out enum requirement from the certbot-auto file and now certificates are created correctly.

1 Like

@bmw @schoen Do you folks have any idea what might cause this Certbot CentOS packaging error?

That sure does look like a bug. We can also ask @joohoi!

1 Like

Looks to me like an instance of https://github.com/certbot/certbot/issues/5456.

1 Like

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