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'
Hi @Casyfill !
Do you have enum34
installed by any chance? You can check that with pip freeze | grep enum34
. If you do, please remove it, it is known to cause issues in many packages.
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 :slightly_smiling_face: 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 pip freeze
so we could confirm my theory? What we could do is require some newer enum34 version in our setup.py, but, as you know, it won't prevent next installed package from installing old enum34 as a dependency :slightly_frowning_face: We might consider checking it at runtime too, though, but as you can see from the traceback, dvc is not even running yet, so that wouldn't be that useful.
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
name: py37
channels:
- anaconda
- conda-forge
dependencies:
- anaconda:python=3.7.3
- anaconda:black
- anaconda:scikit-learn>=0.21.1
- anaconda:ipython
- anaconda:jupyter>=1.0.0
- anaconda:jupyterlab>=0.35.6
- anaconda:pandas
- anaconda:pip
- anaconda:pytest==4.4.0
- anaconda:pytest-cov
- anaconda:pytest-pep8
- anaconda:pytest-benchmark>=3.2.2
- pymssql
- pymysql
- pyyaml
- conda-forge:fiona>=1.8.6
- conda-forge:geopandas>=0.5.0
- conda-forge:s3fs
- conda-forge:jsonschema=2.6.0
- conda-forge:luigi
- conda-forge:sendgrid=5.6.0
- conda-forge:tqdm
- conda-forge:xlsxwriter
- conda-forge:hypothesis
- pip:
- halo
- envkey
- dvc
- snowflake-sqlalchemy
prefix: /Users/philippk/anaconda3/envs/py37
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 is catboost
.
$ 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 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.
Life savers. Thanks.
Was installing a GTFS parser and old tech was being hung up on something I don't even remember installing.
pip uninstall -y enum34
what
This helped me:
I was able to fix this by adding enum34 = "==1.1.8" to pyproject.toml.
Apparently enum34 had a feature in v1.1.8 that avoided this error, but
this regressed in v1.1.9+. This is just a workaround though. The
better solution would be for packages to use environment markers so
you don't have to install enum34 at all unless needed.
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
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:])
@ekanters71 See the recipes above. You just need to uninstall enum34 with pip uninstall -y enum34
.
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?
@ekanters71 It is installed somewhere, you need to find it and remove. Sorry, but you are on your own now :slightly_smiling_face:
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
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:])
It results in:
Hello there test
Traceback (most recent call last):
File "print_args.py", line 20, in
main(sys.argv[1:])
File "print_args.py", line 9, in main
class Modes(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Any help please?
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.....
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
from wtforms import Form, StringField, TextAreaField, PasswordField, validators
File "/home/leeuw/.local/lib/python3.5/site-packages/wtforms/__init__.py", line 11, in
from wtforms import validators, widgets
File "/home/leeuw/.local/lib/python3.5/site-packages/wtforms/validators.py", line 9, in
import email_validator
File "/home/leeuw/.local/lib/python3.5/site-packages/email_validator/__init__.py", line 6, in
import dns.resolver
File "/home/leeuw/.local/lib/python3.5/site-packages/dns/resolver.py", line 32, in
import dns.flags
File "/home/leeuw/.local/lib/python3.5/site-packages/dns/flags.py", line 24, in
class Flag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
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
from wtforms import Form, StringField, TextAreaField, PasswordField,
validators
File
"/home/leeuw/.local/lib/python3.5/site-packages/wtforms/__init__.py", line
11, in
from wtforms import validators, widgets
File
"/home/leeuw/.local/lib/python3.5/site-packages/wtforms/validators.py",
line 9, in
import email_validator
File
"/home/leeuw/.local/lib/python3.5/site-packages/email_validator/__init__.py",
line 6, in
import dns.resolver
File "/home/leeuw/.local/lib/python3.5/site-packages/dns/resolver.py",
line 32, in
import dns.flags
File "/home/leeuw/.local/lib/python3.5/site-packages/dns/flags.py", line
24, in
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 (변기호) <
[email protected]> 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
https://github.com/iterative/dvc/issues/1995#issuecomment-690363903, 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 :slightly_frowning_face:
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.....
Hi, I have the same issue reported above, I have a virtualenv and enum34 is not installed.
So, i have no options to go forward. someone else have the same problem?
@ogonbat
What is the output of your dvc version
?
I have upgraded my python version to 3.7. It is working now. Thanks.
Most helpful comment
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.