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

WinError 2 - System cannot find the file specified. #11

Open
awgeezrick opened this issue Oct 11, 2024 · 4 comments
Open

WinError 2 - System cannot find the file specified. #11

awgeezrick opened this issue Oct 11, 2024 · 4 comments
Labels
wontfix This will not be worked on

Comments

@awgeezrick
Copy link

Import works and the pdf call does create a pdf object


pdf = pypdf2htmlEX.PDF(pdf_file)
pdf.to_html(dest_dir=r'D:\temp')

pdf
<pypdf2htmlEX.core.PDF object at 0x0000025BD596AC50>

, but the pdf.to_html creates the following error:


Traceback (most recent call last):
  File "C:\TPSITS\Program Files\JetBrains\PyCharm Community Edition 2023.3.1\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
  File "C:\TPSITS\PycharmProjects\RandomStuffs\.venv\Lib\site-packages\pypdf2htmlEX\core.py", line 49, in to_html
    self.__make_html(args)
  File "C:\TPSITS\PycharmProjects\RandomStuffs\.venv\Lib\site-packages\pypdf2htmlEX\core.py", line 37, in __make_html
    subprocess.call(options)
  File "C:\Users\b99858\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 389, in call
    with Popen(*popenargs, **kwargs) as p:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\b99858\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\b99858\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
@gabriel-batistuta
Copy link
Owner

Import works and the pdf call does create a pdf object


pdf = pypdf2htmlEX.PDF(pdf_file)
pdf.to_html(dest_dir=r'D:\temp')

pdf
<pypdf2htmlEX.core.PDF object at 0x0000025BD596AC50>

, but the pdf.to_html creates the following error:


Traceback (most recent call last):
  File "C:\TPSITS\Program Files\JetBrains\PyCharm Community Edition 2023.3.1\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
  File "C:\TPSITS\PycharmProjects\RandomStuffs\.venv\Lib\site-packages\pypdf2htmlEX\core.py", line 49, in to_html
    self.__make_html(args)
  File "C:\TPSITS\PycharmProjects\RandomStuffs\.venv\Lib\site-packages\pypdf2htmlEX\core.py", line 37, in __make_html
    subprocess.call(options)
  File "C:\Users\b99858\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 389, in call
    with Popen(*popenargs, **kwargs) as p:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\b99858\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\b99858\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

Hello, sorry for the delay in responding. I checked that you are using Windows, right? Well, this library is not meant to do anything by itself, it is just a wrapper for the pdf2htmlEX tool (https://github.com/pdf2htmlEX/pdf2htmlEX). You can check that the pdf2htmlEX tool does not have a version made for Windows, so it only works in Linux environments. The error you are experiencing is because pypdf2htmlEX is trying to find the pdf2htmlEX library on your system and is not finding it. If you want to use this library, I recommend installing Linux on your PC. Thanks for the issue and sorry again for the delay in responding.

@gabriel-batistuta gabriel-batistuta added the wontfix This will not be worked on label Jan 18, 2025
@TheSuperAgent
Copy link

I tried in linux, but still im getting the same error

@gabriel-batistuta
Copy link
Owner

@BhuviTheDataGuy can you post here the path of pdf that you used and the code?

@gabriel-batistuta
Copy link
Owner

it seems the pdf2htmlEX has many problems now in all platforms, even me cant use this library now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants