pybliometrics-dev / pybliometrics

Python-based API-Wrapper to access Scopus
https://pybliometrics.readthedocs.io/en/stable/
Other
407 stars 127 forks source link

Where is the config.ini located? #280

Closed danareu closed 10 months ago

danareu commented 1 year ago

Hello, I was trying to set up pybliometrics and therefore ran the following command:

import pybliometrics
pybliometrics.scopus.utils.create_config()

However, there is no such file as config.ini in the stated directory. Also, when changing the environment variable, the config.ini is nowhere to be found. Thanks in advance! Dana

Michael-E-Rose commented 1 year ago

When you installed pybliometrics from PyPI, then the file is in ./pybliometrics/ which on Windows is on your user profile. See https://pybliometrics.readthedocs.io/en/stable/configuration.html

If you installed from GitHub, then the file is in ./config/. See https://pybliometrics.readthedocs.io/en/latest/configuration.html

danareu commented 1 year ago

Unfortunately, there is no such file. Also, when downloading it with conda, there is the following message:

  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>

....
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Michael-E-Rose commented 1 year ago

What's your Python version and system you're using?

danareu commented 1 year ago

python 3.10.9

Michael-E-Rose commented 1 year ago

Windows, Linux or Mac?

danareu commented 1 year ago

Windows

Michael-E-Rose commented 1 year ago

Apologies, I forgot about this issue.

First, to find out where the configuration file is located, type

import pybliometrics

pybliometrics.scopus.utils.constants.CONFIG_FILE

for you this should be an object of type WindowsPath().

As a side-note: I usually recommend to install pybliometrics always via pip, even when working in an anaconda environment. conda may make things difficult for packages that are not from the conda repository - as may be in this case.

Michael-E-Rose commented 1 year ago

Any updates? Did you find the file?