我在我的Windows 7上安装了python 2.7。我已经安装了python 2.6自带的Libre Office 3.4。因此,即使在设置所有环境变量之后,我也无法导入uno和unohelper。Python 2.7与pyuno
我需要python 2.7,因此无法恢复到python 2.6,因为我早些时候有Python 2.6与open office 3一起工作。我最近更改为LibreOffice 3.4和Python 2.7(ActivePython 2.7)。
有没有什么办法可以使Python 2.7导入UNO和LibreOffice的3.4
感谢unohelper提前。
我没有在我的系统上安装了Python2.6,所以我试着将LibreOffice 3.4中的python.exe路径设置为“C:\ Program Files(x86)\ LibreOffice 3.4 \ program \ python.exe”。我不知道我正在尝试的是否正确,以及这种提供我的脚本所需的python可执行版本的方式是否正确。 – PyBegginer
@PyBegginer:如果System和LibreOffice python的版本不同,那么你就不能在系统python中运行libreOffice中使用'pyuno'的代码。它并不妨碍你使用你发布的路径中的python运行它。 'pylauncher'允许你在不指定python版本的情况下运行你的脚本(你可以在''#!'''-line'脚本中执行一次脚本)。查看[screencast](http://www.red-dove.com/screencasts/launcher/launcher.html)。 – jfs