# problem compiling python2.7

**URL:** <https://forums.suse.com/t/problem-compiling-python2-7/23539>\
**Category:** SLED Applications\
**Created:** [January 21, 2013, 4:53pm UTC](https://forums.suse.com/t/problem-compiling-python2-7/23539 "2013-01-21T16:53:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![albumns](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@albumns](https://forums.suse.com/u/albumns)\
**Post date:** [January 21, 2013, 4:53pm UTC](https://forums.suse.com/t/problem-compiling-python2-7/23539/1 "2013-01-21T16:53:52Z")

</div>

hello:

I am trying to compile python2.7 in SLED SP2 but it always failed with messages:

```auto
Python build finished, but the necessary bits to build these modules were not found:
_bsddb _tkinter bsddb185        
dl imageop linuxaudiodev   
ossaudiodev sunaudiodev                        
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

Failed to build these modules:
_curses_panel        

```

Since my another software highly depend how well the python it compiled, it always failed with messages:

`/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: cannot find -lpython2.7
collect2: ld returned 1 exit status
scons: *** [objs/Linux/x86_64/gcc-4.6/Release/lib/libDesmond.so] Error 1 `

So I am just wondering how should I compile my python 2.7 correctly?

thank you very much  
best  
Albert

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [January 21, 2013, 6:46pm UTC](https://forums.suse.com/t/problem-compiling-python2-7/23539/2 "2013-01-21T18:46:50Z")

</div>

> [@](#):
>
> On Mon 21 Jan 2013 02:54:01 PM CST, albumns wrote:
> 
> hello:
> 
> I am trying to compile python2.7 in SLED SP2 but it always failed with  
> messages:
> 
> ## Code:
> 
> Python build finished, but the necessary bits to build these modules  
> were not found: \_bsddb \_tkinter bsddb185  
> dl imageop linuxaudiodev  
> ossaudiodev sunaudiodev  
> To find the necessary bits, look in setup.py in detect\_modules() for  
> the module’s name.
> 
> Failed to build these modules:  
> \_curses\_panel
> 
> * * *
> 
> Since my another software highly depend how well the python it  
> compiled, it always failed with messages:
> 
> ## Code:
> 
> /usr/lib64/gcc/x86\_64-suse-linux/4.6/…/…/…/…/x86\_64-suse-linux/bin/ld:  
> cannot find -lpython2.7 collect2: ld returned 1 exit status  
> scons: \*\*\* [objs/Linux/x86\_64/gcc-4.6/Release/lib/libDesmond.so]  
> Error 1 --------------------
> 
> So I am just wondering how should I compile my python 2.7 correctly?
> 
> thank you very much  
> best  
> Albert

Hi  
Do you have an OBS account? Just branch and build (you can build  
locally with the osc command)  
[https://build.opensuse.org/package/show?package=python&project=devel%3Alanguages%3Apython%3AFactory](https://build.opensuse.org/package/show?package=python&project=devel%3Alanguages%3Apython%3AFactory)

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 12.2 (x86\_64) Kernel 3.4.11-2.16-desktop  
up 4 days 19:25, 3 users, load average: 0.17, 0.22, 0.22  
CPU IntelÂ® i5 CPU M520@2.40GHz | GPU IntelÂ® Ironlake Mobile

---

<div class="post-metadata">

**Author:** ![albumns](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@albumns](https://forums.suse.com/u/albumns)\
**Post date:** [January 21, 2013, 9:29pm UTC](https://forums.suse.com/t/problem-compiling-python2-7/23539/3 "2013-01-21T21:29:39Z")

</div>

thank you for kind reply.  
I never use OBS before. And I am reading the manual, here I use command:

osc co Base:build python-base

It download all related file as listed in the link you gave.

what I should do next, so that it can start to compile?

thank you very much

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [January 21, 2013, 10:49pm UTC](https://forums.suse.com/t/problem-compiling-python2-7/23539/4 "2013-01-21T22:49:57Z")

</div>

> [@](#):
>
> On Mon 21 Jan 2013 07:34:01 PM CST, albumns wrote:
> 
> thank you for kind reply.  
> I never use OBS before. And I am reading the manual, here I use  
> command:
> 
> osc co Base:build python-base
> 
> It download all related file as listed in the link you gave.
> 
> what I should do next, so that it can start to compile?
> 
> thank you very much

Hi  
Have you added a SLE build target via the Web interface? When you do  
that it should build automatically, from the command line it would be;

```auto
osc repos
osc build <your target from above output eg SLE_11_SP2> python-base
```

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 12.2 (x86\_64) Kernel 3.4.11-2.16-desktop  
up 0:14, 3 users, load average: 0.20, 0.17, 0.11  
CPU IntelÂ® i5 CPU M520@2.40GHz | GPU IntelÂ® Ironlake Mobile

---

<div class="post-metadata">

**Author:** ![albumns](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@albumns](https://forums.suse.com/u/albumns)\
**Post date:** [January 23, 2013, 4:28pm UTC](https://forums.suse.com/t/problem-compiling-python2-7/23539/5 "2013-01-23T16:28:32Z")

</div>

thank you for kind helps. But I don’t know how to add the build target from web interface… I am sorry I am not famililar with osc in SUSE.

Or, do you have any idea how to solve the issue claimed during the configuration so that I can compile it from source code?

[CODE]Failed to find the necessary bits to build these modules:  
\_bsddb bsddb185 dl  
imageop linuxaudiodev ossaudiodev  
sunaudiodev  
To find the necessary bits, look in setup.py in detect\_modules() for the module’s name.

Failed to build these modules:  
\_curses\_panel [/CODE]

THX a lot

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [January 23, 2013, 7:23pm UTC](https://forums.suse.com/t/problem-compiling-python2-7/23539/6 "2013-01-23T19:23:52Z")

</div>

> [@](#):
>
> On Wed 23 Jan 2013 02:34:02 PM CST, albumns wrote:
> 
> thank you for kind helps. But I don’t know how to add the build target  
> from web interface… I am sorry I am not famililar with osc in  
> SUSE.
> 
> Or, do you have any idea how to solve the issue claimed during the  
> configuration so that I can compile it from source code?
> 
> ## Code:
> 
> Failed to find the necessary bits to build these modules:  
> \_bsddb bsddb185 dl  
> imageop linuxaudiodev ossaudiodev  
> sunaudiodev  
> To find the necessary bits, look in setup.py in detect\_modules() for  
> the module’s name.
> 
> ## Failed to build these modules: \_curses\_panel
> 
> THX a lot

Hi  
Do you actually need those modules? If not, as indicated in the setup.py  
as rem’ing them out…

I have branched python-base and see the same sort of errors…except it  
fails some of the tests.

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 12.2 (x86\_64) Kernel 3.4.11-2.16-desktop  
up 21:09, 4 users, load average: 0.01, 0.04, 0.14  
CPU IntelÂ® i5 CPU M520@2.40GHz | GPU IntelÂ® Ironlake Mobile

---

<div class="post-metadata">

**Author:** ![albumns](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@albumns](https://forums.suse.com/u/albumns)\
**Post date:** [January 23, 2013, 7:34pm UTC](https://forums.suse.com/t/problem-compiling-python2-7/23539/7 "2013-01-23T19:34:17Z")

</div>

Probably I don’t need those modules, but when I skipped the warning and invoke this compiled python for compiling my other softwares, it always have the same issues which claimed:

Python-2.7.3/./Modules/posixmodule.c:7432: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp’  
Stride.o: In function `ss_from_stride(DrawMolecule*)': Stride.C:(.text+0x41): warning: the use of `tempnam’ is dangerous, better use `mkstemp’  
collect2: ld returned 1 exit status

So, this problem should comes from the issue when I compiling Python.

thank you very much

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [January 23, 2013, 8:28pm UTC](https://forums.suse.com/t/problem-compiling-python2-7/23539/8 "2013-01-23T20:28:27Z")

</div>

> [@](#):
>
> On Wed 23 Jan 2013 05:35:01 PM CST, albumns wrote:
> 
> Probably I don’t need those modules, but when I skipped the warning and  
> invoke this compiled python for compiling my other softwares, it always  
> have the same issues which claimed:
> 
> Python-2.7.3/./Modules/posixmodule.c:7432: warning: the use of  
> `tmpnam_r' is dangerous, better use `mkstemp’  
> Stride.o: In function `ss_from_stride(DrawMolecule*)': Stride.C:(.text+0x41): warning: the use of `tempnam’ is dangerous,  
> better use `mkstemp’  
> collect2: ld returned 1 exit status
> 
> So, this problem should comes from the issue when I compiling Python.
> 
> thank you very much

Hi  
Those are only warnings which should not stop compiling, there must be  
an ‘error’ further back in the log file.

Or try to disable them with --disable-werror when you configure…

–  
Cheers Malcolm Â°Â¿Â° (Linux Counter #276890)  
openSUSE 12.2 (x86\_64) Kernel 3.4.11-2.16-desktop  
up 22:12, 3 users, load average: 0.21, 0.18, 0.14  
CPU IntelÂ® i5 CPU M520@2.40GHz | GPU IntelÂ® Ironlake Mobile
