lukasschwab / arxiv.py

Python wrapper for the arXiv API
MIT License
1.07k stars 120 forks source link

Module 'arxiv' has no attribute 'Search' #125

Closed drmwnrafi closed 11 months ago

drmwnrafi commented 11 months ago

I tried using the Search class, but it gave an error. How to fix it?

import arxiv

search = arxiv.Search(
  query = "quantum",
  max_results = 10,
  sort_by = arxiv.SortCriterion.SubmittedDate
)

for result in search.results():
  print(result.title)
AttributeError: partially initialized module 'arxiv' has no attribute 'Search' (most likely due to a circular import)
drmwnrafi commented 11 months ago

The problem was solved by changing the file name, the error was due to naming the python file same as "arxiv.py"

xiaochangaichirou commented 1 week ago

lol!!I made the same mistake, what a funny mistake