Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python36 enum34 issue

See original GitHub issue

I’m attempting to build a project using the Python36 interpreter, and there’s a package that calling for enum34, and I can’t figure out how to prevent it from being installed. Any suggestion regarding which of the built in packages are calling for this or how to prevent it from being installed?

    Complete output from command python egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/jmeekho/projects/vof/mail-extract/build/venv/lib/python3.6/site-packages/setuptools/", line 6, in <module>
        import distutils.core
      File "/Users/jmeekho/projects/vof/mail-extract/build/venv/lib/python3.6/distutils/", line 4, in <module>
        import imp
      File "/Users/jmeekho/projects/vof/mail-extract/build/venv/lib/python3.6/", line 27, in <module>
        import tokenize
      File "/Users/jmeekho/projects/vof/mail-extract/build/venv/lib/python3.6/", line 33, in <module>
        import re
      File "/Users/jmeekho/projects/vof/mail-extract/build/venv/lib/python3.6/", line 142, in <module>
        class RegexFlag(enum.IntFlag):
    AttributeError: module 'enum' has no attribute 'IntFlag'
plugins {
    id 'com.linkedin.python-cli' version '0.9.9'

python {
    testDir = file("tests")
    details.pythonVersion = '3.6'
    details.systemPythonInterpreter = '/usr/local/bin/python3.6'
project.tasks.findByName('installPythonRequirements').sorted = false

dependencies {
    python 'pypi:DateTime:4.3'
    python('pypi:exchangelib:1.12.1') {
        exclude module: 'enum34'

repositories {
 ivy {
    name 'pypi-local'   //optional, but nice
    url './repo'
    layout "pattern", {
      ivy "[organisation]/[module]/[revision]/[module]-[revision].ivy"
      artifact "[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
      m2compatible = true

python.cli.generateCompletions = true

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

jmeekhofcommented, Dec 7, 2018

Using an earlier forcedVersion did the trick. Thanks.

python {
    testDir = file("tests")
    details.pythonVersion = '3.6'
    details.systemPythonInterpreter = '/usr/local/bin/python3.6'
    forceVersion('pypi', 'flake8', '3.2.1')

zvezdancommented, Dec 6, 2018


  • Try putting in the python { ... } closure: forceVersion("pypi", "flake8", "3.2.1") if you can use lower version of flake8. It seems that versions below 3.3.0 did not have that dependency.
  • Alternatively, use older version of pygradle that did not update to flake8-3.6.0.

Notice that there’s nothing wrong here with the flake8 itself. It declares the dependency conditionally in its Python package metadata. It’s the Ivy format used by Gradle that has no notion of conditional dependencies that’s at fault. So, the full solution would be porting our plugins mentioned above.

I hope this helps you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing enum34 on Python 3.x breaks pip for Python3.x
Just delete the package from your site-packages folder manually. Locate it first: python3.6 -c 'import enum; print(enum.__file__)'.
Read more >
[solved] enum34 failed to install - Gentoo Forums :: View topic
emerge -1 enum34 fails with following messages: ... File "/usr/lib/portage/python3.6/", line 14, in <module> import argparse
Read more >
enum34 - PyPI
An enumeration is a set of symbolic names (members) bound to unique, constant values. Within an enumeration, the members can be compared by...
Read more >
Why Python 3.6.1 throws AttributeError: module 'enum' has no ...
It's because your enum is not the standard library enum module. You probably have the package enum34 installed. One way check if this...
Read more >
[Example code]-python3.6 and enum module issue in MAC OS
from enum import Enum. How can I overcome this issue with python 3 version? Note : I do not have enum34 module installed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found