![](/img/trans.png)
[英]Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?
[英]module 'enum' has no attribute 'IntFlag' when creating virtualenv using python3.6?
我在跑步
$ virtualenv -p `which python3.6` env_pcl
#Running virtualenv with interpreter /usr/bin/python3.6
用python3.6
創建一個virtualenv
但出現如下錯誤:
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'
我該如何避免呢?
您的問題可能與在virtualenv中使用Python 3重復
但是,您需要使用第三方virtualenv
嗎?
在最近的python 3版本中,有一個標准的venv模塊。 從3.5版開始,這是創建虛擬環境的推薦方法。
python3 -m venv /path/to/new/virtual/environment
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.