Closed mdroidian closed 1 year ago
I've also tried
import dotenv
dotenv.load_dotenv()
from paperqa import Docs
from paperqa.contrib import ZoteroDB
docs = Docs()
zotero = ZoteroDB(library_type="user") # "group" if group library
for item in zotero.iterate(limit=20):
if item.num_pages > 30:
continue # skip long papers
docs.add(item.pdf, key=item.key)
Same error.
pip install paper-qa
pip install pyzotero
Both return Requirement already satisfied:
Hi @mdroidian can you tell me what version of paper-qa
you're on?
1.1.0
@mdroidian can you upgrade and try again?
Hey @mdroidian, I can't reproduce the issue, this code works fine for me. Perhaps you installed pyzotero into a different env?
For the record, I'm using the following pyproject.toml
(with poetry
):
[tool.poetry]
name = "paperqa"
version = "0.1.1"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"
packages = [{include = "paperqa"}]
[tool.poetry.dependencies]
python = ">=3.8.1,<3.12"
pytest = "^7.2.2"
pre-commit = "^3.2.2"
requests = "^2.28.2"
ipython = "^8.12.0"
jupyter = "^1.0.0"
ipykernel = "^6.22.0"
langchain = ">=0.0.98"
html2text = "^2020.1.16"
openai = ">=0.27.0"
pypdf = "^3.7.0"
faiss-cpu = "^1.7.3"
pycryptodome = "^3.17"
tiktoken = "^0.3.3"
pyzotero = "^1.5.5"
llama-cpp-python = "^0.1.32"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Cheers, Miles
On a different machine (Both Windows), I installed again and ran:
load_dotenv()
from paperqa.contrib import ZoteroDB
docs = paperqa.Docs()
zotero = ZoteroDB(library_type="user") # "group" if group library
for item in zotero.iterate(limit=20):
if item.num_pages > 30:
continue # skip long papers
docs.add(item.pdf, key=item.key)
Error:
Traceback (most recent call last):
File "C:\Users\Michael\Desktop\Projects\dev\paper-qa\paperqa.py", line 4, in <module>
from paperqa.contrib import ZoteroDB
File "C:\Users\Michael\Desktop\Projects\dev\paper-qa\paperqa.py", line 4, in <module>
from paperqa.contrib import ZoteroDB
ModuleNotFoundError: No module named 'paperqa.contrib'; 'paperqa' is not a package
I tried
from dotenv import load_dotenv
load_dotenv()
from paperqa import Docs
from paperqa.contrib import ZoteroDB
docs = Docs()
zotero = ZoteroDB(library_type="user") # "group" if group library
for item in zotero.iterate(limit=20):
if item.num_pages > 30:
continue # skip long papers
docs.add(item.pdf, key=item.key)
And got error:
Traceback (most recent call last):
File "C:\Users\Michael\Desktop\Projects\dev\paper-qa\paperqa.py", line 4, in <module>
from paperqa import Docs
File "C:\Users\Michael\Desktop\Projects\dev\paper-qa\paperqa.py", line 4, in <module>
from paperqa import Docs
ImportError: cannot import name 'Docs' from partially initialized module 'paperqa' (most likely due to a circular import) (C:\Users\Michael\Desktop\Projects\dev\paper-qa\paperqa.py)
Versions
paper-qa 1.1.1
pyzotero 1.5.5
I also tried on WSL2. Same errors.
I'm not very familiar with python dev workflows / environments. Here is what I did:
pip install python-dotenv
pip install paper-qa
pip install pyzotero
py
/python3 paperqa.py
maybe try this, in order
pip install --upgrade --force-reinstall pyzotero
pip install --upgrade --force-reinstall paperqa
My file name was paperqa.py
š¤¦āāļøš
I believe that was causing the error.
Renaming it to paper.py
worked.
Ahaha separately I had the same problem and just happened to peruse this thread. So, thanks for the assist!
I'm trying to run https://github.com/whitead/paper-qa/blob/b20f4e9c72783735bf23cc1c43984c179dd5c731/README.md?plain=1#L172-L180
I've installed
I added a
.env
and tested it.I get this error:
Any ideas what I should try next? š