1

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 ?

jia Jimmy
  • 1,693
  • 2
  • 18
  • 38
  • 1
    Possible duplicate of [Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?](https://stackoverflow.com/questions/43124775/why-python-3-6-1-throws-attributeerror-module-enum-has-no-attribute-intflag) – phd Apr 29 '19 at 12:42
  • 1
    https://stackoverflow.com/search?q=%5Bpython%5D+AttributeError%3A+module+%27enum%27+has+no+attribute+%27IntFlag%27 – phd Apr 29 '19 at 12:42

1 Answers1

2

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
VPfB
  • 14,927
  • 6
  • 41
  • 75
  • Thanks, your answer is helped, but can you still give me some advise about solving my problem with `virtualenv ` above? – jia Jimmy Apr 29 '19 at 11:47
  • @jiaJimmy Unfortunalely I cannot directly answer your question. Didn't the linked question help? It mentions also a bug in an older verions. – VPfB Apr 29 '19 at 12:54