[go: up one dir, main page]

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

Windows machine 'C:\Program' not recognized as an internal or external command, #20

Open
catbears opened this issue Apr 23, 2023 · 0 comments

Comments

@catbears
Copy link
catbears commented Apr 23, 2023

What happend: I installed in a new environment, set up the path like described. Except here I have a more recent version of image magic, so the IMCONV looks like this:
%PROGRAMFILES%\ImageMagick-7.1.0-Q16-HDRI\

Windows finds magick as a command, but when I do
dr-doc-search --train -i "pdfs\my_pdf.pdf" --embedding huggingface

There is this error.

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\user\code_folder\dr_doc_test\venv\Scripts\dr-doc-search.exe\__main__.py", line 7, in <
module>
  File "C:\Users\user\code_folder\dr_doc_test\venv\Lib\site-packages\doc_search\app.py", line 68, in ma
in
    run_workflow(context, training_workflow_steps())
  File "C:\Users\user\code_folder\dr_doc_test\venv\Lib\site-packages\py_executable_checklist\workflow.p
y", line 36, in run_workflow
    __run_step(step, context)
  File "C:\Users\user\code_folder\dr_doc_test\venv\Lib\site-packages\py_executable_checklist\workflow.p
y", line 29, in __run_step
    returned_context = step_instance.execute() or {}
                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\code_folder\dr_doc_test\venv\Lib\site-packages\doc_search\workflow\__init__.py",
line 142, in execute
    run_command(convert_command)
  File "C:\Users\user\code_folder\dr_doc_test\venv\Lib\site-packages\py_executable_checklist\workflow.p
y", line 9, in run_command
    return subprocess.check_output(command, shell=True).decode("utf-8")  # nosemgrep
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'C:\Program Files\ImageMagick-7.1.0-Q16-HDRI\magick convert -density 150 -
trim -background white -alpha remove -quality 100 -sharpen 0x1.0 C:\Users\user\OutputDir\dr-doc-search\my_pdf\my_pdf.pdf[1] -quali
ty 100 C:\Users\user\OutputDir\dr-doc-search\my_pdf\images\outpu
t-1.png' returned non-zero exit status 1.

It seems to me, that this is the problem: 'C:\Program' is not recognized as an internal or external command, operable program or batch file.

In Windows the folder is called Program Files and the space in the name is a reliable source of errors in my scripts. I don't really understand where it comes from in this case.

@catbears catbears changed the title Windows machine 'C: Windows machine 'C:\Program' not found Apr 23, 2023
@catbears catbears changed the title Windows machine 'C:\Program' not found Windows machine 'C:\Program' not recognized as an internal or external command, Apr 23, 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