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

[Bug]: "unconv" installation doesn't work (StirlingPDF for Windows Server 0.36.6) #2602

Open
1 task done
topoldo opened this issue Jan 3, 2025 · 12 comments
Open
1 task done
Labels
Back End Issues related to back-end development

Comments

@topoldo
Copy link

topoldo commented Jan 3, 2025

Installation Method

Local Installation

The Problem

Hi all.
I followed the Windows Guide step by step to get all the docker features of Stirling PDF
Everything is OK except the "unoconv" installation.

Python is 3.13.1 and works fine by itself.
In fact both the verification of its installation and of OpenCV are OK

For what unoconv is concerned, LibreOffice is installed (v. 24.8.4) and its program directory is in the environment variables.
Beside its verification is OK.

When I open command prompt as administrator and I give the command:
pip install unoconv
it seems to install fine, but when I try to verify it using:
unoconv --version
it fails, even if I give the command inside where unoconv is saved, ie
C:\Program Files\Python\Scripts

Please note that it is the same even if I use the command:
pip3 install unoconv

Regards
Topoldo

Version of Stirling-PDF

0.36.6

Last Working Version of Stirling-PDF

?

Page Where the Problem Occurred

No response

Docker Configuration

No response

Relevant Log Output

No response

Additional Information

No response

Browsers Affected

No response

No Duplicate of the Issue

  • I have verified that there are no existing issues raised related to my problem.
Copy link

dosubot bot commented Jan 3, 2025

To address the issue with verifying the unoconv installation on Windows Server, here are a few steps you can try:

  1. Check PATH Environment Variable: Ensure that the directory where unoconv is installed (e.g., C:\Program Files\Python\Scripts) is included in your system's PATH environment variable. You can verify this by running echo %PATH% in the Command Prompt and checking if the path is listed.

  2. Run Command Prompt as Administrator: Make sure you are running the Command Prompt as an administrator when executing the unoconv --version command.

  3. Verify Python and LibreOffice Installation: Double-check that both Python and LibreOffice are correctly installed and that their paths are also included in the PATH environment variable.

  4. Restart Command Prompt: After making changes to the PATH, close and reopen the Command Prompt to ensure the changes take effect.

  5. Test LibreOffice: Run LibreOffice once manually to ensure it initializes properly, as this can sometimes resolve issues with unoconv.

  6. Reinstall unoconv: If the above steps do not resolve the issue, try uninstalling and reinstalling unoconv using the following commands:

    pip uninstall unoconv
    pip install unoconv

These steps should help in resolving the verification issue with unoconv on your Windows Server setup [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added the Back End Issues related to back-end development label Jan 3, 2025
@Frooodle
Copy link
Member

Frooodle commented Jan 3, 2025

Could not reproduce on my machine with python 3.12.5
Not sure if its a python 3.13 issue or something unique

@Frooodle
Copy link
Member

Frooodle commented Jan 3, 2025

but confused by

it fails, even if I give the command inside where unoconv is saved, ie
C:\Program Files\Python\Scripts

Does it just run blank?

@topoldo
Copy link
Author

topoldo commented Jan 4, 2025

No.
Herein I report what happens when I perform test of verification for:
a. Python => OK
b. Libre Office/programs => OK
c. OpenCV which is the other app which depends on Python => OK

2

On the contrary in the screenshot below I report:

  1. The location where "unoconv" is, when I install it using pip or pip3
  2. What I got when I run the verification step, even if I give the comand inside the directory where unoconv is located.

Please note that the translation of the Italian comment is something like:
"noconv" is not recognized as an internal or external command, an executable program or a batch file

Immagine 2025-01-04 124748

Regards,
Topoldo

@lenaderr
Copy link

lenaderr commented Jan 16, 2025

I have same issue. The only way i found to get feedback from unoconv is this:

Image

but thats not fixing the issue with StirlingPDF. I tried on python 3.13.1 and 3.12.5, same result on both versions.

@PacificCosmophile
Copy link

Sorry to mention this issue here,
In Tesseract OCR section of Windows Guide, there's a point

  1. Add to settings.yml in your Stirling PDF installation directory:
system:
   tessdataDir: C:\\Program Files\\Tesseract-OCR\\tessdata

but when I go to C:\Program Files\Stirling-PDF there's no settings.yml file

@lenaderr
Copy link

Sorry to mention this issue here, In Tesseract OCR section of Windows Guide, there's a point

  1. Add to settings.yml in your Stirling PDF installation directory:
system:
   tessdataDir: C:\\Program Files\\Tesseract-OCR\\tessdata

but when I go to C:\Program Files\Stirling-PDF there's no settings.yml file

Wherever you double clicked your Stirlingpdf.exe, in this directory there’s a folder “configs” and there’s the yml. If you installed into Program Files it may need admin or so

@Frooodle
Copy link
Member

Sorry the installer version now places configs in appdata/Stirling-pdf

@Ludy87 Ludy87 added Bug Something isn't working Priority: High Issues or pull requests with high priority and removed Bug Something isn't working Priority: High Issues or pull requests with high priority labels Jan 17, 2025
@PacificCosmophile
Copy link

Thank you for the guidance.

There are two files in C:\Users\<user>\AppData\Roaming\Stirling-PDF\configs
custom_settings.yml
settings.yml

According to the instructions mentioned here https://docs.stirlingpdf.com/Advanced%20Configuration/OCR/

  1. Edit your /configs/settings.yml and update the system.tessdataDir:
system:
  tessdataDir: C:/Program Files/Tesseract-OCR/tessdata # path to Tessdata files

I have placed the above code block in settings.yml file and the OCR function is working flawlessly.

@pea001
Copy link

pea001 commented Jan 22, 2025

I have a similar issue. Here are my specs;

  • OS: Windows Server 2022 Standard Edition (Physical Machine)
  • Here are the order of the system PATH Variables:
    Image

Installation

I attempted everything here in the installation: https://docs.stirlingpdf.com/Installation/Windows%20Installation/#python-and-related-tools

Upon attempting to verify Unoconv after running the pip install I get this error:
Image

I see unoconv existing in the directory but it was installed without an extension.
Image

After renaming it to unoconv.py, i run the same command to verify, I finally get something:
Image

I go to the web page of my Stirling instance and try to convert and get an error.
Image
Image
Image

I copy the same command it tried to do on a different command prompt (making a docx with the same name), and it converts it successfully (the docx file does not exist) but no Unoconv not found error.
Image

I think this may be something to do when the function is called. Could it be it is hard-coded to a specific directory it is trying to call Unoconv from?

@topoldo
Copy link
Author

topoldo commented Jan 23, 2025

Hi
I made some more tests.
As I wrote in the OP, I have(had) Python 3.13.1 and I wasn't able to verify the version of unoconv, even if I have put its path in the ENV.
So I tried to run unoconv directly from inside its directory just to see if it is a recognized command.

In this case I got what it is reported below:
Image

It could noticed that a module recalled inside the unoconv code is not recognized by Python 3.13.1.
I made a little research about that and I found that the distutils module is DEPRECATED starting from Python v. 3.12
Image

Therefore I decided to downgrade my Python to the latest stable version compatible with that module, ie v.3.10.10.
Then I retested all the stuffs, but also in this case I was unsuccessfull:
Image

So I decided to rename unoconv to unoconv.py leaving this script in the same directory where it was installed the first time, ie in:
C:\Program Files\Python\Scripts\

In these conditions, the test was finally successfull as reported below:
Image

So an important finding was that latest stable versions of Python DO NOT support unoconv: you need to use Python < 3.12

What the next? ASAP I 'll try to test if now unoconv works inside Stirling BUT I suspect that it could happen what pea001 reported.

In fact if you go here:
[(https://github.com/unoconv/unoconv)]
you can see that the unoconv README lists a series of "caveats"because also Libreoffice/OpenOffice have their "Python runtime" built inside their dirs and this can conflict with an autonomous Python version installed in the same PC.

Regards,
Topoldo

@topoldo
Copy link
Author

topoldo commented Jan 23, 2025

I'm here again!
I tried a very simple conversion to pdf, starting from a .txt file.
Stirling was 0.38 server portable.
When I run Stirling-PDF as admin the command window showed this:
Image
ie unoconv program is NOT recognized.

My question is: which python.exe is trying to run unoconv.py?
Th version which I installed from scratch ie v.3.10.10, or it is the version embedded in LibreOffice, ie:
C:\Program Files\LibreOffice\program\python-core-3.9.21\bin\python.exe
which is a different version?

The debug for Stirling is attached here:
info.log.txt

Regards,
Topoldo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Back End Issues related to back-end development
Projects
None yet
Development

No branches or pull requests

6 participants