[2.4.2] Compiling Python with packages?

G

Gilles Ganault

Hello

I need to compile Python with the packages "socket,sys,time,os", but
I've never done it before, and would like confirmation that this will
work as planned:

======
make clean
../configure --with-socket --with-sys --with-time --with-os
make
make install
======

In addition, are there recommended switches I should know about?

Incidently, is there an equivalent to PHP's phpinfo() to check what
packages Python provides on a host?

Thank you.
 
M

Martin v. Löwis

I need to compile Python with the packages "socket,sys,time,os", but
I've never done it before, and would like confirmation that this will
work as planned:

======
make clean
./configure --with-socket --with-sys --with-time --with-os
make
make install
======

No, it won't. You don't give any arguments to configure normally,
when building Python. Instead, setup.py will detect what libraries
are on your system, and use them.

There are a few --enable and --with flags supported; ask --help
what they are.

The modules you want to have (socket, sys, time, and os) are always
built.
In addition, are there recommended switches I should know about?

Incidently, is there an equivalent to PHP's phpinfo() to check what
packages Python provides on a host?

There is sys.builtin_module_names. However, some modules are
not builtin (they are shared libraries instead); it's easiest
to ls build/lib.<system> after compiling Python to see what
modules have been built.

Regards,
Martin
 
G

Gilles Ganault

No, it won't. You don't give any arguments to configure normally,
when building Python. Instead, setup.py will detect what libraries
are on your system, and use them.

Thanks for the tip.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top