I have 2 python versions 2.7 and 3.6. I set my virtual environment to run on python3
# virtualenv -p python3 venv
# source venv/bin/activate
# pip install -r requirements.txt
When I try to install modules I get following error,
Collecting enum==0.4.6 (from -r requirements.txt (line 12))
Using cached https://files.pythonhosted.org/packages/0c/4e/1ea357e7783c756bb579333c1e4a026fb331371ee771f616ffedc781e531/enum-0.4.6.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/ratha/projects/test711/ATGWS/venv/lib/python3.6/site-packages/setuptools/__init__.py", line 5, in <module>
import distutils.core
File "/Users/ratha/projects/test711/ATGWS/venv/lib/python3.6/distutils/__init__.py", line 4, in <module>
import imp
File "/Users/ratha/projects/test711/ATGWS/venv/lib/python3.6/imp.py", line 27, in <module>
import tokenize
File "/Users/ratha/projects/test711/ATGWS/venv/lib/python3.6/tokenize.py", line 33, in <module>
import re
File "/Users/ratha/projects/test711/ATGWS/venv/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/ct/v0v5ht_n32n6c_33dw1td2fc0000gp/T/pip-install-36x_vm0b/enum/
In my code, I use following import;
from enum import Enum
How can I overcome this issue with python 3 version?
Note : I do not have enum34
module installed
#pip uninstall enum34 :Skipping enum34 as it is not installed.
This answers here didnt solve my issue Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?