Python 2.7 with pinot

I have python 2.7 installed on my windows 7. I installed Libre Office 3.4, which comes with python 2.6. Therefore, I cannot import uno and unohelper even after setting all environment variables.

I need python 2.7, so I can’t go back to python 2.6, because I used to have python 2.6 working with open office 3. I recently changed to LibreOffice 3.4 and Python 2.7 (ActivePython 2.7).

Is there a way to make python 2.7 to import uno and unohelper LibreOffice 3.4

Thanks in advance.

+4
source share
3 answers

.pyc files and C extensions are not compatible between Python versions 2.6 and 2.7. Install pylauncher and use python2.6 shebang in scripts that work with Libre Office.

From the link provided in response to OpenOffice.org using pyUno ​​for Windows, to a Python question? :

Conditions: Call the Python version installed using OpenOffice. "OO-Python. Let the version of Python installed separately (for c: \ Python26, for example) be called 'System-Python'.

You need to know SIX things to successfully import the uno module into your System-Python interpreter. 1) OO-Python version number. Your System-Python version number should be the same as your OO-Python version number. [my accent] ...

+2
source

ubuntu 13.10 and later, you need to install openoffice 4.1.1.

  • remove libreoffice and openoffice

     sudo apt-get remove libreoffice* openoffice* sudo apt-get autoremove 
  • install Apache OpenOffice 4.1.1 on 64-bit Ubuntu

     wget sourceforge.net/projects/openofficeorg.mirror/files/4.1.1/binaries/en-GB/Apache_OpenOffice_4.1.1_Linux_x86-64_install-deb_en-GB.tar.gz tar -xzvf Apache_OpenOffice_4.1.1_Linux_x86-64_install-deb_en-GB.tar.gz cd en-GB/DEBS sudo dpkg -i *.deb cd desktop-integration sudo dpkg -i *.deb 
  • install Apache OpenOffice 4.1.1 on 32-bit Ubuntu

     wget sourceforge.net/projects/openofficeorg.mirror/files/4.1.1/binaries/en-GB/Apache_OpenOffice_4.1.1_Linux_x86_install-deb_en-GB.tar.gz tar -xzvf Apache_OpenOffice_4.1.1_Linux_x86_install-deb_en-GB.tar.gz cd en-GB/DEBS sudo dpkg -i *.deb cd desktop-integration sudo dpkg -i *.deb 
  • tap uno.pth for python2.7

     echo /opt/openoffice4/program |sudo tee /usr/lib/python2.7/dist-packages/uno.pth 
+2
source

In ubuntu 14.04

open a terminal and run the following command ...

 sudo apt-get install libreoffice python-genshi python-cairo python-lxml python-setuptools sudo apt-get install libreoffice-script-provider-python easy_install uno 
0
source

Source: https://habr.com/ru/post/919933/


All Articles