-
Notifications
You must be signed in to change notification settings - Fork 1.2k
AttributeError: module 'enum' has no attribute 'IntFlag' #1995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Casyfill ! Do you have |
got it! hm, now I wonder which package requires it as a dependency (given that everything worked fine 3 days ago) |
@efiop is there a workaround on the DVC side we can implement so that we do not depend on the environment in this case? |
@shcheklein As you can see from the traceback, it is not about us per se 🙂 As far as I know, the issue is caused by some old enum34 installed, which breaks the environment basically for everything that is using newer features. @Casyfill Maybe you have enum34 version in your console from the time you've run |
I don't have pip freeze per se, but I was able to reproduce it having the conda env below.
|
I have the issue as well. Uninstallation of $ pip show enum34
Name: enum34
Version: 1.1.6
Summary: Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4
Home-page: https://bitbucket.org/stoneleaf/enum34
Author: Ethan Furman
Author-email: [email protected]
License: BSD License
Location: .../.env/lib/python3.7/site-packages
Requires:
Required-by: catboost |
Hi @daskol ! Thanks for reporting this! Looks like |
Life savers. Thanks. |
|
what |
This helped me:
Source: python-poetry/poetry#1122 |
Hi there. I am struggling as well and getting an error at Any help is appreciated. /volume1/@appstore/py3k/usr/local/lib/python3.5/enum.py
|
@ekanters71 See the recipes above. You just need to uninstall enum34 with |
I have tried to installed enum34 on all my pip instances available on my Synology system. Always the same: WARNING: Skipping enum34 as it is not installed. Any other suggestions? |
@ekanters71 It is installed somewhere, you need to find it and remove. Sorry, but you are on your own now 🙂 |
`enum34` seems to be causing some issues on newer versions of Python, example: iterative/dvc#1995 (comment) Using a PEP508 environmental marker (https://www.python.org/dev/peps/pep-0508/) to only include for 3.3 or older versions of Python
Thanks for your comments. I am on 3.5. I have tried to remove enum34 and I think it worked but by Code still is causing the same error. I have a bigger program but I have condensed it to the problem Gather our code in a main() functiondef main(argv): class Modes(enum.IntFlag): print ('Hello there', sys.argv[1]) if name == name: It results in: Any help please? |
i also have the same issue of error while working on pycharm |
hi. M having a similar issue but uninstalling unum34 doesn't solve it, here is my traceback: Traceback (most recent call last): |
Hi @Leeuw-Maluleka, we no longer support Python 3.5. DVC requires Python 3.6 or later. |
Hi @pieter Rowlands
thank you for the reply. I need help and hope you can help me. I am fairly
new to flask and trying to submit my school assignment which for now needs
a user registration for that validates and prevents users from using the
same username. I tried this using wtforms but when I run my app on the
terminal I get the below error:
Traceback (most recent call last):
File "run.py", line 3, 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'
hope you will be able to assist me so I can submit my assignment. the
complete project will be a todo list app
Regards,
…On Thu, Sep 10, 2020 at 5:24 PM Peter Rowlands (변기호) < ***@***.***> wrote:
Hi @Leeuw-Maluleka <https://github.com/Leeuw-Maluleka>, we no longer
support Python 3.5. DVC requires Python 3.6 or later.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1995 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHNACRVGRMURRWENIEY2JQTSFDVS7ANCNFSM4HMRCHGA>
.
--
Warm Regards,
|
@Leeuw-Maluleka The issue is in https://github.com/rthalley/dnspython package, not in dvc. I don't think you are using dvc at all. There is not much we can do, you are on your own 🙁 |
Hi, I have the same issue reported above, I have a virtualenv and enum34 is not installed. |
@ogonbat |
I have upgraded my python version to 3.7. It is working now. Thanks. |
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 these package versions have conflicting dependencies. The conflict is caused by: bandit 1.1.0 depends on PyYAML>=3.1.0 cliff 3.4.0 depends on PyYAML>=3.12 openstacksdk 0.52.0 depends on PyYAML>=3.13 Bump our lower constraint for PyYAML to resolve this issue. With that resolved, we see a new issue: ERROR: Could not find a version that satisfies the requirement cryptography>=2.7 (from openstacksdk) ERROR: No matching distribution found for cryptography>=2.7 This is less self-explanatory but looking at the lower-constraints for openstacksdk 0.52.0 shows a dependency on cryptography 2.7 [1], meaning we need to bump this also. Next up, flake8-import-order seems to cause the dependency resolver to go nuts, eventually ending with the following error message in a Python 3.6 environment: Using cached enum34-1.1.2.zip (49 kB) ERROR: Command errored out with exit status 1: command: ... cwd: ... Complete output (9 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File ".../lib/python3.6/site-packages/setuptools/__init__.py", line 7, in <module> import setuptools.distutils_patch # noqa: F401 File ".../lib/python3.6/site-packages/setuptools/distutils_patch.py", line 9, in <module> import re File "/usr/lib64/python3.6/re.py", line 142, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' ---------------------------------------- A quick Google suggests this is because the enum34 package is not complete [2]. We shouldn't even be using it since our base virtualenv should at least use Python 3.6, but I guess some dependency doesn't properly restrict the dependency to <= Python 3.4. This is moved from 'test-requirements.txt' to 'tox.ini' since we don't need to use our constraints machinery for linters. Finally, the versions of bandit and hacking that pip is bringing in both requires in a newer version of babel, which in turn requires a new version of pytz. Collecting hacking>=2.0.0 ... ERROR: Cannot install oslo.i18n because these package versions have conflicting dependencies. The conflict is caused by: babel 2.9.0 depends on pytz>=2015.7 babel 2.8.1 depends on pytz>=2015.7 babel 2.8.0 depends on pytz>=2015.7 babel 2.7.0 depends on pytz>=2015.7 Seeing as we shouldn't be tracking bandit in lower-constraints, I'm not sure why we're want to bump these dependencies for just that. As above, we move these dependencies out of 'test-requirements' and into 'tox.ini' since we can do that for linters. [1] https://opendev.org/openstack/openstacksdk/src/tag/0.52.0/requirements.txt#L19 [2] iterative/dvc#1995 (comment) Change-Id: I8ec738fbcabc8d8553db79a876e5592576cd18fa Signed-off-by: Stephen Finucane <[email protected]>
* Update python-openstackclient from branch 'master' to 20769cd7b27d51da84a324a17922427eba5c6eac - 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 these package versions have conflicting dependencies. The conflict is caused by: bandit 1.1.0 depends on PyYAML>=3.1.0 cliff 3.4.0 depends on PyYAML>=3.12 openstacksdk 0.52.0 depends on PyYAML>=3.13 Bump our lower constraint for PyYAML to resolve this issue. With that resolved, we see a new issue: ERROR: Could not find a version that satisfies the requirement cryptography>=2.7 (from openstacksdk) ERROR: No matching distribution found for cryptography>=2.7 This is less self-explanatory but looking at the lower-constraints for openstacksdk 0.52.0 shows a dependency on cryptography 2.7 [1], meaning we need to bump this also. Next up, flake8-import-order seems to cause the dependency resolver to go nuts, eventually ending with the following error message in a Python 3.6 environment: Using cached enum34-1.1.2.zip (49 kB) ERROR: Command errored out with exit status 1: command: ... cwd: ... Complete output (9 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File ".../lib/python3.6/site-packages/setuptools/__init__.py", line 7, in <module> import setuptools.distutils_patch # noqa: F401 File ".../lib/python3.6/site-packages/setuptools/distutils_patch.py", line 9, in <module> import re File "/usr/lib64/python3.6/re.py", line 142, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' ---------------------------------------- A quick Google suggests this is because the enum34 package is not complete [2]. We shouldn't even be using it since our base virtualenv should at least use Python 3.6, but I guess some dependency doesn't properly restrict the dependency to <= Python 3.4. This is moved from 'test-requirements.txt' to 'tox.ini' since we don't need to use our constraints machinery for linters. Finally, the versions of bandit and hacking that pip is bringing in both requires in a newer version of babel, which in turn requires a new version of pytz. Collecting hacking>=2.0.0 ... ERROR: Cannot install oslo.i18n because these package versions have conflicting dependencies. The conflict is caused by: babel 2.9.0 depends on pytz>=2015.7 babel 2.8.1 depends on pytz>=2015.7 babel 2.8.0 depends on pytz>=2015.7 babel 2.7.0 depends on pytz>=2015.7 Seeing as we shouldn't be tracking bandit in lower-constraints, I'm not sure why we're want to bump these dependencies for just that. As above, we move these dependencies out of 'test-requirements' and into 'tox.ini' since we can do that for linters. [1] https://opendev.org/openstack/openstacksdk/src/tag/0.52.0/requirements.txt#L19 [2] iterative/dvc#1995 (comment) Change-Id: I8ec738fbcabc8d8553db79a876e5592576cd18fa Signed-off-by: Stephen Finucane <[email protected]>
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 able to avoid these issues, but a regression was introduced in 1.1.9 and is still present in the most recent release [2]. This commit loosens the requirement on enum34 so that it is only installed if Python 3.3 or older is used. This particular solution requires setuptools v36.2 or newer [3]. If older versions of setuptools need to be supported, then the requirements can be put into an extras_require clause [4, 5]. [0]: python-poetry/poetry#1122 [1]: iterative/dvc#1995 [2]: https://web.archive.org/web/20200621215937/https://bitbucket.org/stoneleaf/enum34/issues/31/make-the-install-a-noop-on-python36 [3]: https://setuptools.readthedocs.io/en/latest/history.html#v36-2-0 [4]: robshakir/pyangbind#232 (comment) [5]: https://gitlab.com/pycqa/flake8/-/merge_requests/191/diffs
This is a combination of 2 commits, as both are needed to unblock Ussuri gate. 1. [stable-only] lower-contraints: Bump various packages * amqp==2.5.0 & kombu==4.6.1 via oslo.messaging I4b72d8feb85c2b9b4657510c356cd21e22fe40c2 * enum34==1.1.8 to workaround known issues with the package The associated repo and issue tracker is currently offline so I can't link the actual issue here but it's widely reported elsewhere. iterative/dvc#1995 * hacking==3.0.1 introduced via Ie00c10332bd7110169dbb150d601c157b6694d05 * oslo.context==2.22.0 introduced via oslo-policy 3.1.0 * stestr==2.0.0 introduced via oslotest 3.8.0 2. Disable qos resize tempest test for nova-multi-cell job It turned out that during the qos resize work we did not implemented support of cross cell resize with qos ports. Tempest test coverage for the resize and migrate is landed recently that made the nova-multi-cell job to fail. So this patch disables the qos resize and migrate tempest tests for the nova-multi-cell job to unblock the gate. Related-Bug: #1907522 [1] I8c573c4a11a76932057d8415d76114a03269b9f3 (cherry picked from commit 048250a) Change-Id: Ib0e09df9d61e42592c2d36ceed7f38c1278c53b2 Closes-Bug: #1907756
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 these package versions have conflicting dependencies. The conflict is caused by: bandit 1.1.0 depends on PyYAML>=3.1.0 cliff 3.4.0 depends on PyYAML>=3.12 openstacksdk 0.52.0 depends on PyYAML>=3.13 Bump our lower constraint for PyYAML to resolve this issue. With that resolved, we see a new issue: ERROR: Could not find a version that satisfies the requirement cryptography>=2.7 (from openstacksdk) ERROR: No matching distribution found for cryptography>=2.7 This is less self-explanatory but looking at the lower-constraints for openstacksdk 0.52.0 shows a dependency on cryptography 2.7 [1], meaning we need to bump this also. Next up, flake8-import-order seems to cause the dependency resolver to go nuts, eventually ending with the following error message in a Python 3.6 environment: Using cached enum34-1.1.2.zip (49 kB) ERROR: Command errored out with exit status 1: command: ... cwd: ... Complete output (9 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File ".../lib/python3.6/site-packages/setuptools/__init__.py", line 7, in <module> import setuptools.distutils_patch # noqa: F401 File ".../lib/python3.6/site-packages/setuptools/distutils_patch.py", line 9, in <module> import re File "/usr/lib64/python3.6/re.py", line 142, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' ---------------------------------------- A quick Google suggests this is because the enum34 package is not complete [2]. We shouldn't even be using it since our base virtualenv should at least use Python 3.6, but I guess some dependency doesn't properly restrict the dependency to <= Python 3.4. This is moved from 'test-requirements.txt' to 'tox.ini' since we don't need to use our constraints machinery for linters. Finally, the versions of bandit and hacking that pip is bringing in both requires in a newer version of babel, which in turn requires a new version of pytz. Collecting hacking>=2.0.0 ... ERROR: Cannot install oslo.i18n because these package versions have conflicting dependencies. The conflict is caused by: babel 2.9.0 depends on pytz>=2015.7 babel 2.8.1 depends on pytz>=2015.7 babel 2.8.0 depends on pytz>=2015.7 babel 2.7.0 depends on pytz>=2015.7 Seeing as we shouldn't be tracking bandit in lower-constraints, I'm not sure why we're want to bump these dependencies for just that. As above, we move these dependencies out of 'test-requirements' and into 'tox.ini' since we can do that for linters. Modifications: tox.ini NOTE(stephenfin): A cap is placed on the version of hacking used to prevent us bringing in 4.0.0, which requires additional fixes. [1] https://opendev.org/openstack/openstacksdk/src/tag/0.52.0/requirements.txt#L19 [2] iterative/dvc#1995 (comment) Change-Id: I8ec738fbcabc8d8553db79a876e5592576cd18fa Signed-off-by: Stephen Finucane <[email protected]> (cherry picked from commit 20769cd)
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 these package versions have conflicting dependencies. The conflict is caused by: bandit 1.1.0 depends on PyYAML>=3.1.0 cliff 3.4.0 depends on PyYAML>=3.12 openstacksdk 0.52.0 depends on PyYAML>=3.13 Bump our lower constraint for PyYAML to resolve this issue. With that resolved, we see a new issue: ERROR: Could not find a version that satisfies the requirement cryptography>=2.7 (from openstacksdk) ERROR: No matching distribution found for cryptography>=2.7 This is less self-explanatory but looking at the lower-constraints for openstacksdk 0.52.0 shows a dependency on cryptography 2.7 [1], meaning we need to bump this also. Next up, flake8-import-order seems to cause the dependency resolver to go nuts, eventually ending with the following error message in a Python 3.6 environment: Using cached enum34-1.1.2.zip (49 kB) ERROR: Command errored out with exit status 1: command: ... cwd: ... Complete output (9 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File ".../lib/python3.6/site-packages/setuptools/__init__.py", line 7, in <module> import setuptools.distutils_patch # noqa: F401 File ".../lib/python3.6/site-packages/setuptools/distutils_patch.py", line 9, in <module> import re File "/usr/lib64/python3.6/re.py", line 142, in <module> class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag' ---------------------------------------- A quick Google suggests this is because the enum34 package is not complete [2]. We shouldn't even be using it since our base virtualenv should at least use Python 3.6, but I guess some dependency doesn't properly restrict the dependency to <= Python 3.4. This is moved from 'test-requirements.txt' to 'tox.ini' since we don't need to use our constraints machinery for linters. Finally, the versions of bandit and hacking that pip is bringing in both requires in a newer version of babel, which in turn requires a new version of pytz. Collecting hacking>=2.0.0 ... ERROR: Cannot install oslo.i18n because these package versions have conflicting dependencies. The conflict is caused by: babel 2.9.0 depends on pytz>=2015.7 babel 2.8.1 depends on pytz>=2015.7 babel 2.8.0 depends on pytz>=2015.7 babel 2.7.0 depends on pytz>=2015.7 Seeing as we shouldn't be tracking bandit in lower-constraints, I'm not sure why we're want to bump these dependencies for just that. As above, we move these dependencies out of 'test-requirements' and into 'tox.ini' since we can do that for linters. Conflicts: lower-constraints.txt test-requirements.txt NOTE(stephenfin): Conflicts are due to the absence of ddt and presence of mock in lower-constraints.txt and test-requirements.txt, respectively. Modifications: lower-constraints.txt NOTE(stephenfin): There's no need to bump cryptography here since we're using an older version of openstacksdk. [1] https://opendev.org/openstack/openstacksdk/src/tag/0.52.0/requirements.txt#L19 [2] iterative/dvc#1995 (comment) Change-Id: I8ec738fbcabc8d8553db79a876e5592576cd18fa Signed-off-by: Stephen Finucane <[email protected]> (cherry picked from commit 20769cd) (cherry picked from commit 83cd9b5)
i faced the same issue, i had file called enum.py that i created for storing enums for pydantic, but when i reopen the same notebook, and kernal was not starting, so i deleted enum.py file, and it started working again, |
python 3.6, dvc 0.40.1
on almost any command throws issue (warning?):
The text was updated successfully, but these errors were encountered: