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

TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType #101

Open
JJery-web opened this issue Dec 26, 2022 · 1 comment

Comments

@JJery-web
Copy link

Hello. My code is:

from refextract import extract_references_from_file
import os

--- main ---

path="E:\finance Python\2022 business\1226 pdf\42_56\"
name="test.pdf"
file=name
print(file)
st = os.stat(file)
print(st)
references = extract_references_from_file(os.path.join(path, name))
print(references[0])

But unfortunately, I don't know why the path is an error. I also change the path to "test.pdf" but can not function. Please help!

@JJery-web
Copy link
Author

I find this helps me.
jalan/pdftotext#16

All hope is not lost on the windows version. There is a command line utility with the same name and you can use the subprocess package to execute pdftotext

PDFtotext windows download instruction, credit @s2t2

Go to https://www.xpdfreader.com/download.html and click "Download the Xpdf tools"
Uncompress/extract the zip file, and move the folder to a location like the Desktop or the Programs directory.
Inside the unzipped folder, copy the file bin64/pdftotext.exe into your project repository

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