“我正在运行一个python问题,我正在运行一个枚举文件:
Traceback (most recent call last):
File "lowest_common_ancestor.py", line 4, in <module>
from test_framework import generic_test, test_utils
File "/Users/linh/Documents/EPIJudge/epi_judge_python/test_framework/generic_test.py", line 6, in <module>
from test_framework.generic_test_handler import GenericTestHandler
File "/Users/linh/Documents/EPIJudge/epi_judge_python/test_framework/generic_test_handler.py", line 5, in <module>
from test_framework.binary_tree_utils import assert_equal_binary_trees, is_object_tree_type
File "/Users/linh/Documents/EPIJudge/epi_judge_python/test_framework/binary_tree_utils.py", line 5, in <module>
from test_framework.test_failure import TestFailure, PropertyName
File "/Users/linh/Documents/EPIJudge/epi_judge_python/test_framework/test_failure.py", line 2, in <module>
from enum import Enum, auto
ImportError: cannot import name 'auto'
我知道我有Python2.7,而“import Enum”只存在于python3中,但是我在如何创建两个不同的环境时遇到了困难,其中我同时拥有python2.7和python3。如何在macunix终端上实现这一点,我也不太熟悉。在
或者你自己这样做:
auto
直到python3.6才出现,并且不在enum34
后台端口中。如果您想要2/3兼容的代码,则需要使用^{我对macunix终端没有任何经验。在
1公开:我是Python stdlib ^{} 、^{} backport 和{a4}库的作者。在
相关问题 更多 >
编程相关推荐