LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-28-2016, 02:19 AM   #1
Ammad
Member
 
Registered: Apr 2004
Distribution: redhat 9.0, fc4, redhat as 4
Posts: 522

Rep: Reputation: 31
Liberoffice installation and Python issue...


Hi,

I am trying to install Libre-Office-5.2.4 from source on ubuntu, and getting issue for Python. for this I have installed Python using source-code in /opt/Python3.6 directory, here is the outcome of /opt/Python3.6

Code:
$ ls -l /opt/Python3.6/
total 16
drwxr-xr-x 2 root root 4096 Dec 26 16:45 bin
drwxr-xr-x 3 root root 4096 Dec 26 16:24 include
drwxr-xr-x 4 root root 4096 Dec 26 16:45 lib
drwxr-xr-x 3 root root 4096 Dec 26 16:45 share
when i try to configure office for installation it fail to find Python.

Code:
libreoffice-5.2.4.2$ ./configure --with-python=/opt/Python3.6/
....
....
....
checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 3.6
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
checking which Python to use for Pyuno... checking for a Python interpreter with version >= 3.3... python
checking for python... /usr/bin/python
checking for python version... 3.6
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
system
checking Python.h usability... no
checking Python.h presence... no
checking for Python.h... no
configure: error: Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables

for the above error i have already set the env variables

Code:
libreoffice-5.2.4.2$ echo $PYTHON_LIBS
/opt/Python3.6/include/python3.6m

libreoffice-5.2.4.2$ echo $PYTHON_CFLAGS
/opt/Python3.6/include/python3.6m

/libreoffice-5.2.4.2$ ls -l /opt/Python3.6/include/python3.6m/Python.h
-rw-r--r-- 1 root root 2928 Dec 26 16:24 /opt/Python3.6/include/python3.6m/Python.h
 
Old 12-28-2016, 04:54 AM   #2
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
checking for python... /usr/bin/python
Quote:
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
I guess setting variables don't cut her. Have a look at the top part of the libreoffice configure script see if you can set (change) the desired directories there.

Something that worked well for me in the past, when I needed to inject all necessary files in their proper place for booting up with the necessary proprietary graphics drivers enabled (Nvidia,AMD) if a supported chip was detected during early bootup on a Debian live system. I would do a mock install of Nvidia to see what would get installed, downloaded the packages and had a look inside to see what all files it had and where they would go.
I had placed the files in /root and had my own compliant boot script that pumped the files in place at the right time and the OS would automatically have proprietary video support for either make of card automatically.
Maybe try this with your package manager and see if you can place the necessary files from your build in the directories other applications would look for them, might save you a lot of headaches in the long run.

Last edited by Brains; 12-28-2016 at 05:08 AM.
 
Old 12-28-2016, 06:12 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Moderator response

Moved: This thread is more suitable in <Ubuntu> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 12-28-2016, 06:37 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,306
Blog Entries: 3

Rep: Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720Reputation: 3720
I'd highly recommend rolling custom packages for both Python and LibreOffice. That will save a lot of trouble, such as some of what you are encountering already. Mixing and matching manually installed packages almost never works out well, and will always be a lot of effort. You can get the source packages for both python and libreoffice using apt-get:

Code:
mkdir /tmp/scratch/ && cd /tmp/scratch/
apt-get source libreoffice python
From there you'd substitute in the new source code. There's obviously more to it than just that, but you can find many tutorials and guides on the topic for Ubuntu or Debian. Both apply, at least until snappy is fully deployed in Ubuntu. Which version of Ubuntu?
 
Old 12-28-2016, 11:53 PM   #5
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
Quote:
Originally Posted by Ammad View Post
Hi,

I am trying to install Libre-Office-5.2.4 from source on ubuntu, and getting issue for Python. for this I have installed Python using source-code in /opt/Python3.6 directory, here is the outcome of /opt/Python3.6

Code:
$ ls -l /opt/Python3.6/
total 16
drwxr-xr-x 2 root root 4096 Dec 26 16:45 bin
drwxr-xr-x 3 root root 4096 Dec 26 16:24 include
drwxr-xr-x 4 root root 4096 Dec 26 16:45 lib
drwxr-xr-x 3 root root 4096 Dec 26 16:45 share
when i try to configure office for installation it fail to find Python.

Code:
libreoffice-5.2.4.2$ ./configure --with-python=/opt/Python3.6/
....
....
....
checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 3.6
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
checking which Python to use for Pyuno... checking for a Python interpreter with version >= 3.3... python
checking for python... /usr/bin/python
checking for python version... 3.6
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
system
checking Python.h usability... no
checking Python.h presence... no
checking for Python.h... no
configure: error: Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables
What is in your /opt/Python3.6/include/ directory? It's possible that you may need to do this
Code:
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
to install the correct header files.
 
Old 01-02-2017, 01:03 AM   #6
Ammad
Member
 
Registered: Apr 2004
Distribution: redhat 9.0, fc4, redhat as 4
Posts: 522

Original Poster
Rep: Reputation: 31
i have moved the liberoffice to parent-directory... and this solved the issue...of ./configure but now when i do compilation it fails with new error message.


/opt/libreoffice-5.2.4.2$ make
======================================================================
ERROR: test_ssl_import (testssl.SSLTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/libreoffice-5.2.4.2/pyuno/qa/pytests/testssl.py", line 7, in test_ssl_import
import ssl
File "/opt/Python3.6/lib/python3.6/ssl.py", line 101, in <module>
import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'

----------------------------------------------------------------------
Ran 1 test in 0.003s

FAILED (errors=1)
You need gdb in your path to show backtraces

Error: a unit test failed, please do one of:
make PythonTest_pyuno_pytests_ssl CPPUNITTRACE="gdb --args"
# for interactive debugging on Linux
make PythonTest_pyuno_pytests_ssl VALGRIND=memcheck
# for memory checking
make PythonTest_pyuno_pytests_ssl DEBUGCPPUNIT=TRUE
# for exception catching

/opt/libreoffice-5.2.4.2/solenv/gbuild/PythonTest.mk:35: recipe for target '/opt/libreoffice-5.2.4.2/workdir/PythonTest/pyuno_pytests_ssl/done' failed
make[1]: *** [/opt/libreoffice-5.2.4.2/workdir/PythonTest/pyuno_pytests_ssl/done] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:256: recipe for target 'build' failed
make: *** [build] Error 2
/opt/libreoffice-5.2.4.2$
 
Old 11-17-2018, 11:54 AM   #7
Telo
LQ Newbie
 
Registered: Jun 2017
Distribution: Debian
Posts: 11

Rep: Reputation: Disabled
Smile Solution

I fixed this by installing the libpython3-dev package.

(Note, I already had the libpython-dev installed.)


----------


Before installing this package:

Code:
sudo find / -name Python.h
/usr/include/python2.7/Python.h
After installing this package:

Code:
sudo find / -name Python.h
/usr/include/python2.7/Python.h
/usr/include/python3.5m/Python.h
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
abnormal working of Ubuntu laptop ; problems with LIberOffice Writer otar Linux - Laptop and Netbook 9 10-12-2013 06:51 AM
About development of LiberOffice Writer otar Linux - Software 3 10-08-2013 02:58 AM
Python issue pra838 Linux - Server 2 09-22-2013 11:08 PM
Python issue markez Ubuntu 0 10-31-2009 11:00 AM
Python issue coolman0stress Programming 7 05-11-2004 01:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration