不可能进口python-uno

发布于 2025-01-21 10:29:18 字数 1357 浏览 4 评论 0原文

我的目标是编写一个使用libreoffice打开数千个XLS文件并将其保存为CSV文件的Python脚本(文件已损坏,因此我需要使用Libreoffice打开它们,然后使用Libreoffice将其保存为CSV)。

看来Python Uno是这样做的方式,但我无法使其起作用。 我正在使用Linux Mint 20.3(UNA),而Python 3.7.4

这是我所做的:

命令提示:

sudo apt apt update

sudo apt -y apt -y install install python3 -uno

python3-uno is already the newest version (1:6.4.7-0ubuntu0.20.04.4).

然后我打开python,然后尝试导入uno:

python3

导入uno

>>> import uno
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'uno'

我尝试了我在Internet上发现的每个“解决方案”,但它们都没有起作用。 其中包括:

卸载uno并再次安装: https://www.youtube.com/watch?v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.youtube.com/watch? = 3xD9OF_05LK

确保我正在使用Python3: ImportError: no module named uno bug

Trying to install uno with "sudo apt-get install libreoffice-script-provider-python":

我尝试过的时间太长了,无法在这里适合。

My goal is to write a python script that uses LibreOffice to open thousands of xls files and save them as csv files (the files are corrupted, so I need to open them using LibreOffice and then use LibreOffice to save them as csv).

It seems that python uno is the way to do it, but I cannot make it work.
I am using Linux Mint 20.3 (Una), and Python 3.7.4

This is what I did:

Command prompt:

sudo apt update

sudo apt -y install python3-uno

python3-uno is already the newest version (1:6.4.7-0ubuntu0.20.04.4).

Then I open python and try to import uno:

python3

import uno

>>> import uno
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'uno'

I have tried every single "solution" I found on the internet, none of which worked.
They included:

Uninstalling Uno and installing again: https://www.youtube.com/watch?v=3XD9Of_05lk

Making sure that I am using python3: Import uno ImportError: no module named uno bug

Trying to install uno with "sudo apt-get install libreoffice-script-provider-python": https://askubuntu.com/questions/418225/how-do-i-install-the-python-uno-package

The list of things that I tried is too long to fit here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文