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

cannot import name 'cached_property' from 'nougat.utils' #3

Closed
nunamia opened this issue Dec 1, 2023 · 2 comments
Closed

cannot import name 'cached_property' from 'nougat.utils' #3

nunamia opened this issue Dec 1, 2023 · 2 comments

Comments

@nunamia
Copy link

nunamia commented Dec 1, 2023

I'm used python3.9 env

(venv) (base) marker dev % python3 convert_single.py /Users/nunamia/Documents/github/nougat/demo /Users/nunamia/Documents/github/nougat/demo/output.md
Traceback (most recent call last):
File "/Users/nunamia/Documents/github/marker/convert_single.py", line 3, in
from marker.convert import convert_single_pdf
File "/Users/nunamia/Documents/github/marker/marker/convert.py", line 6, in
from marker.cleaners.equations import replace_equations
File "/Users/nunamia/Documents/github/marker/marker/cleaners/equations.py", line 8, in
from nougat import NougatModel
File "/Users/nunamia/Documents/github/marker/venv/lib/python3.9/site-packages/nougat/init.py", line 1, in
from nougat.app import Nougat
File "/Users/nunamia/Documents/github/marker/venv/lib/python3.9/site-packages/nougat/app.py", line 5, in
from nougat.asgi import serve
File "/Users/nunamia/Documents/github/marker/venv/lib/python3.9/site-packages/nougat/asgi.py", line 6, in
from nougat.context.request import Request
File "/Users/nunamia/Documents/github/marker/venv/lib/python3.9/site-packages/nougat/context/init.py", line 1, in
from nougat.context.request import Request
File "/Users/nunamia/Documents/github/marker/venv/lib/python3.9/site-packages/nougat/context/request.py", line 8, in
from nougat.utils import cached_property, File
ImportError: cannot import name 'cached_property' from 'nougat.utils' (/Users/nunamia/Documents/github/marker/venv/lib/python3.9/site-packages/nougat/utils/init.py)

I search find this code:
https://github.com/Riparo/nougat/blob/8453bc37e0b782f296952f0a418532ebbbcd74f3/nougat/context/request.py#L81

But I checked the official version and there is no such part of the code.

the version is:
[[package]]
name = "nougat-ocr"
version = "0.1.17"
description = "Nougat: Neural Optical Understanding for Academic Documents"
optional = false
python-versions = ">=3.7"
files = [
{file = "nougat_ocr-0.1.17-py3-none-any.whl", hash = "sha256:f776732c716250972c7de11a47b36e94fa48e271d67045a427f19f12eeeef118"},
]

@nunamia
Copy link
Author

nunamia commented Dec 1, 2023

nougat-ocr and nougat are not the same project?

@nunamia
Copy link
Author

nunamia commented Dec 1, 2023

Fix this problem; don't install Nougat, just install Nougat-OCR.

@nunamia nunamia closed this as completed Dec 1, 2023
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

1 participant