Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular import issue #2

Closed
qiyan98 opened this issue Jul 30, 2024 · 3 comments
Closed

Circular import issue #2

qiyan98 opened this issue Jul 30, 2024 · 3 comments

Comments

@qiyan98
Copy link

qiyan98 commented Jul 30, 2024

Hi there,

Thanks a lot for building this wonderful project. I tried running your demo but unfortunately got an error on python import. I tried on both my mac and a linux workstation and neither worked. Please see the error message below.

> cat citation_map.py
from citation_map import generate_citation_map

# This is my Google Scholar ID. Replace this with your ID.
scholar_id = '3rDjnykAAAAJ'
generate_citation_map(scholar_id)
> python citation_map.py
Traceback (most recent call last):
  File "/home/qiyan/Downloads/citation_map.py", line 1, in <module>
    from citation_map import generate_citation_map
  File "/home/qiyan/Downloads/citation_map.py", line 1, in <module>
    from citation_map import generate_citation_map
ImportError: cannot import name 'generate_citation_map' from partially initialized module 'citation_map' (most likely due to a circular import) (/home/qiyan/Downloads/citation_map.py)

Any help is greatly appreciated. Thanks!

@ChenLiu-1996
Copy link
Owner

ChenLiu-1996 commented Jul 30, 2024

Hi qiyan98,

Oh I perhaps know what the problem is. It is probably because the name of your script and the name of the package are the same. Try renaming your citation_map.py to something else.

Also, you probably want to use your own scholar ID instead of mine. Unfortunately with the current version, you won't get many chances to run this before you get blocked by Google Scholar.

@ChenLiu-1996
Copy link
Owner

Please let me know if this fixes your problem. If so I will close the issue.

@qiyan98
Copy link
Author

qiyan98 commented Jul 30, 2024

Thank you so much! It works perfectly now.

@qiyan98 qiyan98 closed this as completed Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants