# Install Libreoffice -> Python flags trouble



## Nex (Jan 6, 2013)

I try to install libreoffice, but it stops with error:


```
********************************************************************
*
*   Running LibreOffice build configuration.
*
********************************************************************

checking build system type... amd64-portbld-freebsd9.1
checking host system type... amd64-portbld-freebsd9.1
checking for sed... /usr/bin/sed
checking the FreeBSD operating system release... found OSVERSION=901000

.....

checking which Python to use... system
checking whether /usr/local/bin/python2.7 version is >= 2.6... yes
checking for /usr/local/bin/python2.7 version... 2.7
checking for /usr/local/bin/python2.7 platform... freebsd9
checking for /usr/local/bin/python2.7 script directory... ${prefix}/lib/python2.7/site-packages
checking for /usr/local/bin/python2.7 extension module directory... ${exec_prefix}/lib/python2.7/site-packages
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.
===>  Script "configure" failed unexpectedly.
Please report the problem to office@FreeBSD.org [maintainer] and attach the
"/usr/ports/editors/libreoffice/work/libreoffice-core-3.5.7.2/config.log"
```

port lang/python27 installed
pkg_version output:


```
pkg_version: the package info for package 'perl-threaded-5.14.2_2' is corrupt
pkg_version: the package info for package 'pixman-0.24.2' is corrupt
pkg_version: the package info for package 'pkg-1.0.2' is corrupt
pkg-config                          ?
pkg_version: the package info for package 'pkgconf-0.8.9' is corrupt
pkg_version: the package info for package 'png-1.5.12' is corrupt
pkg_version: the package info for package 'pth-2.0.7' is corrupt
pkg_version: the package info for package 'py27-libxml2-2.7.8_2' is corrupt
pkg_version: the package info for package 'python27-2.7.3_3' is corrupt
python27                            =
python32                            =
```

What shall I do to install libreoffice?


----------



## je33 (Jan 6, 2013)

If you installed python27 with PTH, you might try reinstalling without or vice versa:
	
	



```
# cd /usr/ports/lang/python27
# make config    ; toggle pthreads option and save options
# make clean     ; to be sure old Python configuration file is gone.
# make reinstall clean
```
Then rebuild your libreoffice.

I've been having mixed results with/without pthreads when building ports that depend on Python.

Also, you want to post threads about ports in "Installation and Maintenance of FreeBSD Ports or Packages". Don't be surprised if a mod moves this thread.

Hope this helps.


----------



## wblock@ (Jan 6, 2013)

Have you switched to pkgng?  If so, don't use pkg_version(1) any more, use pkg version.


----------



## Nex (Jan 7, 2013)

je33 said:
			
		

> If you installed python27 with PTH, you might try reinstalling without or vice versa:
> 
> 
> 
> ...


----------



## CaveMan (Nov 17, 2018)

*On Debian, I fixed this by installing the `libpython3-dev` package. *

(Note, I already had the *libpython-dev* installed but was still getting this error message.)

*Before* installing this package:

`sudo find / -name Python.h
    /usr/include/python2.7/Python.h`

*After* installing this package:

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

I had previously successfully built LO, but now a year later ran into this error.  Glad to have found a solution for it.


----------



## ShelLuser (Nov 17, 2018)

CaveMan said:


> *On Debian, I fixed this by installing the `libpython3-dev` package. *


Bullshit, because on Debian you wouldn't build this package in the first place. Not to mention that this is totally irrelevant for FreeBSD.

Please keep in mind that you're responding to a 5 year old thread. And the solution to this problem has been found already: `# pkg install libreoffice`, done.


----------

