对于我添加的 Python 文件:
from google.cloud.talent_v4beta1.types import RequestMetadata
from google.cloud.talent_v4beta1.types import JobView
from google.cloud.talent_v4beta1.types import SearchMode
所有三行都被 pylint 接受。但是当我尝试导入 JobView 和/或 SearchMode 时,运行会产生 ImportError。
ImportError: cannot import name 'SearchMode' from 'google.cloud.talent_v4beta1.types
ImportError: cannot import name 'JobView' from 'google.cloud.talent_v4beta1.types
我也尝试search_mode
过,但 pylint 抱怨,ImportError
如果我尝试运行代码,我可以。
最终,这些值映射到字符串,所以我可以很简单地添加"JOB_SEARCH"
,"JOB_VIEW_FULL"
但我想使用谷歌的 API,因为它打算使用。我肯定需要访问其他值。