2

Today I wrote a script in Python to extract some data from Scopus API. The script was working perfectly. All of a sudden my code crashed and did not execute again. It shows an error when I import Scopus module:

import scopus

This is the error that I receive:

    "D:/PhD/Projects/Code/scopus/main.py"
Traceback (most recent call last):
  File "D:/PhD/Projects/Code/scopus/main.py", line 1, in <module>
    import scopus
  File "C:\Users\myUser\AppData\Local\Continuum\anaconda3\lib\site-packages\scopus\__init__.py", line 7, in <module>
    from scopus.utils import *
  File "C:\Users\myUser\AppData\Local\Continuum\anaconda3\lib\site-packages\scopus\utils\__init__.py", line 1, in <module>
    from scopus.utils.create_config import *
  File "C:\Users\myUser\AppData\Local\Continuum\anaconda3\lib\site-packages\scopus\utils\create_config.py", line 5, in <module>
    from scopus.utils.startup import config, CONFIG_FILE
  File "C:\Users\myUser\AppData\Local\Continuum\anaconda3\lib\site-packages\scopus\utils\startup.py", line 23, in <module>
    config.add_section('Warnings')
  File "C:\Users\myUser\AppData\Local\Continuum\anaconda3\lib\configparser.py", line 1200, in add_section
    super().add_section(section)
  File "C:\Users\myUser\AppData\Local\Continuum\anaconda3\lib\configparser.py", line 659, in add_section
    raise DuplicateSectionError(section)
configparser.DuplicateSectionError: Section 'Warnings' already exists

Any kind of help would be appreciated.

amiref
  • 3,181
  • 7
  • 38
  • 62
  • 1
    Looks like a poorly designed module. If you can kill all python processes it might be able to kill the extra `Warning`, but I would be inclined to go and remove `C:\Users\myUser\AppData\Local\Continuum\anaconda3\lib\site-packages\scopus\utils\startup.py", line 23` so no Warning gets added to config any more. – Rocky Li Oct 19 '18 at 01:31
  • @RockyLi, I did what you said, but it raise a new error: ModuleNotFoundError: No module named 'scopus.utils.startup' – amiref Oct 19 '18 at 01:44
  • The package has long been renamed to `pybliometrics`. – MERose Aug 29 '20 at 15:58

1 Answers1

1

I just realized what to do to resolve the error. I opened the file mentioned in the error:

C:\Users\myUser\AppData\Local\Continuum\anaconda3\lib\site-packages\scopus\utils\startup.py

Then, I commented line 23, and problem solved!

amiref
  • 3,181
  • 7
  • 38
  • 62