简体   繁体   中英

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 ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM