0

For a Python file I've added:

from google.cloud.talent_v4beta1.types import RequestMetadata
from google.cloud.talent_v4beta1.types import JobView
from google.cloud.talent_v4beta1.types import SearchMode

All three lines are accepted by pylint. But running produces an ImportError when I try to import JobView and/or SearchMode.

ImportError: cannot import name 'SearchMode' from 'google.cloud.talent_v4beta1.types

ImportError: cannot import name 'JobView' from 'google.cloud.talent_v4beta1.types

I've tried search_mode too but pylint complains and I can an ImportError if I try to run the code.

Ultimately, these values map to strings so I can be brittle and simple add "JOB_SEARCH" and "JOB_VIEW_FULL" but I would like to use Google's API as it was intended to be used. And there's bound to be other values I'll need to access.

Carl
  • 2,896
  • 2
  • 32
  • 50
  • Have you added those libraries to your project? Something similar to [this](https://stackoverflow.com/questions/19885821/how-do-i-import-modules-in-pycharm/32911111) in `pycharm`. You may need to add the modules manually! – M.K Jun 26 '19 at 14:28
  • yes, I've added Google Cloud Talent Solution libraries to my project. I've already used the API to add and update jobs. Now I've moved to Search and hit this simple import problem. Note that: from google.cloud.talent_v4beta1.types import RequestMetadata does work proving I have access to "types" – Carl Jun 26 '19 at 14:35

1 Answers1

0

Found the definitions in \google\cloud\talent_v4beta1\gapic\enums.py

from google.cloud.talent_v4beta1 import enums

enums.SearchJobsRequest.SearchMode.JOB_SEARCH
enums.JobView.JOB_VIEW_FULL
enums.CommuteMethod.DRIVING
enums.CommuteMethod.TRANSIT
Carl
  • 2,896
  • 2
  • 32
  • 50