If you get a circular-import AttributeError importing from serpapi, check your own filename first - the reporter had named their script serpapi.py, so Python imported the script instead of the installed package. Rename your file to anything else and the import works. This bites any library, but it is especially confusing here because the error message points at the serpapi module itself.

Context: Issue serpapi/google-search-results-python#42 (closed, 5 comments): from serpapi import GoogleSearch raised AttributeError - partially initialized module serpapi has no attribute GoogleSearch, most likely due to a circular import. The reporter confirmed the root cause themselves.