jia Jimmy
jia Jimmy

Reputation: 1848

module 'enum' has no attribute 'IntFlag' when creating virtualenv using python3.6?

I'm runing

$ virtualenv -p `which python3.6` env_pcl

#Running virtualenv with interpreter /usr/bin/python3.6

to create an virtualenv by python3.6

but an error appeared like below:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 8, in <module>
    import base64
  File "/usr/lib64/python3.6/base64.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'

How can I do to avoid it ?

Upvotes: 1

Views: 5330

Answers (1)

VPfB
VPfB

Reputation: 17282

Your question is probably a duplicate of Using Python 3 in virtualenv

However, do you need to use the third party virtualenv?

In recent python 3 versions there is a standard venv module. It is the recommended way to create virtual environments since version 3.5.

python3 -m venv /path/to/new/virtual/environment

Upvotes: 2

Related Questions