Hugh Cole-Baker created AIRFLOW-3779:
----------------------------------------
Summary: Installing airflow with dependency enum34 on Python 3.6
breaks built-in "re" module
Key: AIRFLOW-3779
URL: https://issues.apache.org/jira/browse/AIRFLOW-3779
Project: Apache Airflow
Issue Type: Bug
Environment: Mac OS 10.13.6, Python 3.6.4_4 installed from Homebrew.
Reporter: Hugh Cole-Baker
Installing airflow in a Python 3.6 virtualenv brings in the enum34 package as a
dependency.
Having enum34 installed seems like it is not compatible with the standard
library in Python 3.6, as I've found that it breaks the built-in "re" module
when subsequently running "pip install .", with this exception:
{code:java}
$ pip install .
Processing /Users/hugh/Source/fd_af_datapipe
Installing build dependencies ... error
Complete output from command
/Users/hugh/.virtualenvs/fd_af_datapipe/bin/python3.6
/Users/hugh/.virtualenvs/fd_af_datapipe/lib/python3.6/site-packages/pip install
--ignore-installed --no-user --prefix
/private/var/folders/tx/9dc1l9sx4pvcst982rwbjwtw0000gn/T/pip-build-env-tnyffy_z/overlay
--no-warn-script-location --no-binary :none: --only-binary :none: -i
https://pypi.org/simple -- setuptools>=40.2.0 wheel:
Traceback (most recent call last):
File
"/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py",
line 193, in _run_module_as_main
"__main__", mod_spec)
File
"/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py",
line 85, in _run_code
exec(code, run_globals)
File
"/Users/hugh/.virtualenvs/fd_af_datapipe/lib/python3.6/site-packages/pip/__main__.py",
line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File
"/Users/hugh/.virtualenvs/fd_af_datapipe/lib/python3.6/site-packages/pip/_internal/__init__.py",
line 4, in <module>
import locale
File "/Users/hugh/.virtualenvs/fd_af_datapipe/lib/python3.6/locale.py",
line 16, in <module>
import re
File "/Users/hugh/.virtualenvs/fd_af_datapipe/lib/python3.6/re.py", line
142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
{code}
As a workaround, uninstalling enum34 with "pip uninstall enum34" stops this
error from occurring.
As far as I know, enum34 is not required on Python 3.4 upwards, so I'd suggest
not including it in the dependencies of Airflow if Airflow is being installed
on Python >= 3.4.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)