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

/usr/local/bin/unoconv:19: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives #591

Open
pctcocom opened this issue Jan 19, 2022 · 9 comments

Comments

@pctcocom
Copy link

/usr/local/bin/unoconv:19: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.version import LooseVersion unoconv: Cannot find a suitable office installation on your system. ERROR: Please locate your office installation and send your feedback to: https://github.com/dagwieers/unoconv/issues

@hasansalimkanmaz
Copy link

+1

@Wchert
Copy link

Wchert commented Mar 18, 2022

+1 how to solve?

@wolframroesler
Copy link

Having the same problem, but with a slightly different message:

/usr/bin/unoconv:778: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if product.ooName not in ('LibreOffice', 'LOdev') or LooseVersion(product.ooSetupVersion) <= LooseVersion('3.3'):

Happens when converting a .docx file to a pdf.

For the record: Using Ubuntu 22.04 with the apt-get version of unoconv:

$ unoconv --version
unoconv 0.7
Written by Dag Wieers <[email protected]>
Homepage at http://dag.wieers.com/home-made/unoconv/

platform posix/linux
python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]
LibreOffice 7.3.5.2

@rcrath
Copy link

rcrath commented Dec 5, 2022

+1

1 similar comment
@FlameJodie
Copy link

+1

@ZiTAL
Copy link

ZiTAL commented Feb 1, 2024

Maybe you are trying to convert a docx to doc like me, finally i used libreoffice:

libreoffice --headless --convert-to docx input.doc

libreoffice-writer needed to do that

apt-get install libreoffice-writer

@mariovials
Copy link

Any solution?

@dwvisser
Copy link

dwvisser commented Oct 25, 2024

In Ubuntu 24.04, unoconv provided by APT unoconv package fails to run now due to this:

$ which unoconv
/usr/bin/unoconv

$ unoconv
Traceback (most recent call last):
  File "/usr/bin/unoconv", line 19, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

The script at /usr/bin/unoconv has a "crunchbang" line of #!/usr/bin/python3, i.e., system Python, as its first line, so without modification, it is essentially broken.

@dwvisser
Copy link

A colleague of mine figured out a workaround that would work. Insert the following line

import setuptools.dist

before this line in /usr/bin/unoconv:

from distutils.version import LooseVersion

As you can see, it means running the unoconv script then has a runtime dependency on the setuptools package. On Ubuntu, the easiest way to satisfy this is apt install python3-setuptools.

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

9 participants