Closed etsern closed 3 years ago
Which pybliometrics.__version__
are you using? 3.0.0?
pybliometrics-3.0.0
And how does your config.ini
look like? Is it somehow similar to what's described in https://pybliometrics.readthedocs.io/en/stable/configuration.html?
I had the same problem. I have solved this problem by removing the "try-except" structure in "startup.py". Specifically, I replace the following code:
try:
config = configparser.ConfigParser()
config.optionxform = str
config.read(CONFIG_FILE)
# Parse keys with fixture for RTFD.io
try:
KEYS = [k.strip() for k in config.get('Authentication', 'APIKey').split(",")]
except configparser.NoSectionError:
pass
except FileNotFoundError:
import warnings
text = "pybliometrics did not find a configuration file. Please issue "\
"pybliometrics.scopus.utils.create_config() to start the process "\
"which guides you through the generation of the configuration "\
"file or read https://pybliometrics.readthedocs.io/en/stable/configuration.html."
warnings.warn(text, UserWarning)
with the code:
config = configparser.ConfigParser()
config.optionxform = str
config.read(CONFIG_FILE)
KEYS = [k.strip() for k in config.get('Authentication', 'APIKey').split(",")]
I remember in 3.0.0 I caused a bug that prevented new users to properly run pybliometrics the first time. It's not occurring anymore, and I think it's because of 71a022d5ba6ebceb6ab271d63cbefff23f1767a0 possibly in conjunction with c05526b3b979abc6bb0a23938c7c1125f0713e3b.
@Michael-E-Rose Please re-open this issue, it seems like if you try this using python 3.7 or higher this error will occur and it's bugging me.
Reopening around doesn't solve it. What version are you using, @fahmij8 ?
I believe it's the latest version @Michael-E-Rose
It clearly says you're on 3.0.1.
I suspect your error is related to the fact that you're running on a notebook. Let met tell you, it won't work anyways, for reasons outlined in https://pybliometrics.readthedocs.io/en/stable/access.html (unless you use InstToken, which is rare).
Do you have the possibility to use a local environment with your institution's VPN?
I see, yup I do. Thanks for the assistance!
The import failure is essentially due to a fixture I implement to automatically generate the documentation. I bet the import on google colab fails for the same reason. I might find time later this week to try another fixture, but in any case, the colab doesn't provide the necessary access rights.
@fahmij8 As a result, I use the previous versions of pybliometrics. @Michael-E-Rose Even with tokens, the new version doesn't work in colab.
Bug report I am using pybliometrics in googlecolab. I am using Scopus Api key with tokken. Everything was working fine, but this week the following error appears:
ImportError: cannot import name 'KEYS' from 'pybliometrics.scopus.utils.startup' (/usr/local/lib/python3.7/dist-packages/pybliometrics/scopus/utils/startup.py)
. It appears, when I use ScopusSearch.How to solve this problem?