dvc: AttributeError: module 'enum' has no attribute 'IntFlag'
python 3.6, dvc 0.40.1
on almost any command throws issue (warning?):
Failed to import the site module
Traceback (most recent call last):
File "/Users/philippk/anaconda3/envs/py36/lib/python3.6/site.py", line 541, in <module>
main()
File "/Users/philippk/anaconda3/envs/py36/lib/python3.6/site.py", line 522, in main
known_paths = addusersitepackages(known_paths)
File "/Users/philippk/anaconda3/envs/py36/lib/python3.6/site.py", line 282, in addusersitepackages
user_site = getusersitepackages()
File "/Users/philippk/anaconda3/envs/py36/lib/python3.6/site.py", line 258, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/Users/philippk/anaconda3/envs/py36/lib/python3.6/site.py", line 248, in getuserbase
USER_BASE = get_config_var('userbase')
File "/Users/philippk/anaconda3/envs/py36/lib/python3.6/sysconfig.py", line 608, in get_config_var
return get_config_vars().get(name)
File "/Users/philippk/anaconda3/envs/py36/lib/python3.6/sysconfig.py", line 587, in get_config_vars
import _osx_support
File "/Users/philippk/anaconda3/envs/py36/lib/python3.6/_osx_support.py", line 4, in <module>
import re
File "/Users/philippk/anaconda3/envs/py36/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 8
- Comments: 24 (9 by maintainers)
Commits related to this issue
- Only install `enum34` on py<3.4 `enum34` seems to be causing some issues on newer versions of Python, example: https://github.com/iterative/dvc/issues/1995#issuecomment-491889669 Using a PEP508 en... — committed to FlippAre/pynssm by FlippAre 4 years ago
- Fix lower-constraints job pip 20.3 finally includes a proper dependency resolver. Its use is causing the following error messages on the lower-constraints job: ERROR: Cannot install ... because th... — committed to openstack/python-openstackclient by stephenfin 4 years ago
- Update git submodules * Update python-openstackclient from branch 'master' to 20769cd7b27d51da84a324a17922427eba5c6eac - Fix lower-constraints job pip 20.3 finally includes a proper depe... — committed to openstack/openstack by stephenfin 4 years ago
- Require enum34 only for Python versions before 3.4 enum34 appears to be a potential source of problems when installed in environments using Python 3.4 or later [0, 1]. Apparently enum34 1.1.8 was abl... — committed to ts826848/mssql-cli by deleted user 4 years ago
- [stable-only] fix lower-constraints and disable qos resize This is a combination of 2 commits, as both are needed to unblock Ussuri gate. 1. [stable-only] lower-contraints: Bump various packages * ... — committed to openstack/nova by lyarwood 4 years ago
- Fix lower-constraints job pip 20.3 finally includes a proper dependency resolver. Its use is causing the following error messages on the lower-constraints job: ERROR: Cannot install ... because th... — committed to openstack/python-openstackclient by stephenfin 4 years ago
- Fix lower-constraints job pip 20.3 finally includes a proper dependency resolver. Its use is causing the following error messages on the lower-constraints job: ERROR: Cannot install ... because th... — committed to openstack/python-openstackclient by stephenfin 4 years ago
Hi @Casyfill !
Do you have
enum34
installed by any chance? You can check that withpip freeze | grep enum34
. If you do, please remove it, it is known to cause issues in many packages.pip uninstall -y enum34
I have the issue as well. Uninstallation of
enum34
solved the issue. I am working in virtual environemnt with Python3.7. In my case the dependent iscatboost
.i also have the same issue of error while working on pycharm i also tried to run pip uninstall enum34 command but it shows me that enum34 was not installed i dont know what to do i have pyhton 3.8 version please help by any other solution THANKS…
what
I have upgraded my python version to 3.7. It is working now. Thanks.
Hi @daskol !
Thanks for reporting this! Looks like
catboost
shouldn’t install enum34 in newer python versions: https://github.com/catboost/catboost/blob/6550fd5ef349acd08d021f8210e322201b169951/catboost/python-package/setup.py#L30 . It should probably be handled similar to how these guys have fixed it https://github.com/donnemartin/saws/commit/f109bc8f534905797ee44239cb766ea3de4ceb5d . We’ve looked for some kind of preemptive solution on our side, but looks like it should indeed be handled by projects that are actually using enum34.hi. M having a similar issue but uninstalling unum34 doesn’t solve it, here is my traceback:
Traceback (most recent call last): File “run.py”, line 2, in <module> from wtforms import Form, StringField, TextAreaField, PasswordField, validators File “/home/leeuw/.local/lib/python3.5/site-packages/wtforms/init.py”, line 11, in <module> from wtforms import validators, widgets File “/home/leeuw/.local/lib/python3.5/site-packages/wtforms/validators.py”, line 9, in <module> import email_validator File “/home/leeuw/.local/lib/python3.5/site-packages/email_validator/init.py”, line 6, in <module> import dns.resolver File “/home/leeuw/.local/lib/python3.5/site-packages/dns/resolver.py”, line 32, in <module> import dns.flags File “/home/leeuw/.local/lib/python3.5/site-packages/dns/flags.py”, line 24, in <module> class Flag(enum.IntFlag): AttributeError: module ‘enum’ has no attribute ‘IntFlag’
I have tried to installed enum34 on all my pip instances available on my Synology system. /usr/bin/pip uninstall -y enum34 /usr/bin/pip2 uninstall -y enum34 /usr/bin/pip2.7 uninstall -y enum34 /volume1/@appstore/py3k/usr/local/bin/pip uninstall -y enum34 /volume1/@appstore/py3k/usr/local/bin/pip3 uninstall -y enum34
Always the same: WARNING: Skipping enum34 as it is not installed.
Any other suggestions?
Hi there. I am struggling as well and getting an error at class Modes(enum.IntFlag): AttributeError: module ‘enum’ has no attribute ‘IntFlag’
Any help is appreciated.
/volume1/@appstore/py3k/usr/local/lib/python3.5/enum.py Using Python executable: /volume1/@appstore/py3k/usr/local/bin/python3 Using Python version: 3.5.1 (default, Jan 29 2018, 14:18:59) [GCC 4.9.3 20150311 (prerelease)] Platform: Linux-3.10.105-x86_64-with-glibc2.3.4 PYTHONPATH: None
import sys import enum
def main(argv): print (‘Hello there’, sys.argv[1])
class Modes(enum.IntFlag): Listen = 1
print (‘Hello there’, sys.argv[1])
if name == name: main(sys.argv[1:])
This helped me:
Source: https://github.com/python-poetry/poetry/issues/1122
Life savers. Thanks. Was installing a GTFS parser and old tech was being hung up on something I don’t even remember installing.
I don’t have pip freeze per se, but I was able to reproduce it having the conda env below. Given that it just started to happen, I blame the last lib I installed -
halo
, but didn’t have a chance so far to check if I am correct