Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If I choose to install Python by typing:

apt-get install python3.1 python-dev

Are there any differences between compiling and installing from source?

Would the source code include everything in python-dev?

share|improve this question

migrated from stackoverflow.com Aug 11 '12 at 4:01

This question came from our site for professional and enthusiast programmers.

    
Which distro/version are you using? –  izx Aug 13 '12 at 2:20
add comment

5 Answers 5

up vote 1 down vote accepted
+50

Compiling the package with just the installation parameters you need can help tailor it to your exact needs, for example using experimental features disabled by default.

However, if the package has many installation parameters, you will need to choose a good and viable parameters set. Normally, documentation is lacking about these parameters, so it is easy enough to end up with non-viable software.

If the compiled software does not work, you will need to ask for help from the developers. However, they will not normally fix non-standard compilations.

Conclusion: Compiling from source has its advantages, but if problems occur you are on your own. The apt-get package will, on the other hand, almost always work as well as it can.

share|improve this answer
add comment

The packages have been designed to play nice with the other packages and with the general behavior of the distro. Any compatibility issues with self-compiled software is your problem.

share|improve this answer
1  
Also compiling from source is generally guaranteed to get you the latest version, for better or for worse. The package manager, on the other hand, often has an older version corresponding to when the distro was updated. –  Amber Aug 6 '12 at 3:27
    
... For varying definitions of "updated"... –  Ignacio Vazquez-Abrams Aug 6 '12 at 3:28
    
so there would be something missing if i compiled from source compared with the python-dev package, is it? –  Kit Ho Aug 6 '12 at 3:29
    
OTOH there are often "fill-in" repositories for when you need the newest of a particular application. Ubuntu does that well with PPAs off launchpad. –  Dirk Eddelbuettel Aug 6 '12 at 3:29
    
@Kit: Possibly. Certainly any distro-specific patches would be omitted. –  Ignacio Vazquez-Abrams Aug 6 '12 at 3:31
add comment

The source should contain the python static library which, as I understand it, is what the python-dev package is. Make sure that the "include" directory is set up in your compiler options.

In my experience it's best to use apt-get first. If problems arise (relatively unlikely, depends on how much you like tinkering with your system) start looking at compiling from source.

share|improve this answer
add comment

Installing via apt-get will give you the version supported by your distro. The benefits are ease of installation and you can easily get security updates via apt-get update/upgrade.

Installing from source may give you more control over what options are enabled in Python and ensures you get the version you want (not all distros provide the "latest and greatest"). However, there is no simple mechanism for getting security updates for your install.

share|improve this answer
add comment

The difference between downloading a pre-configured package and compiling from source is this:

Pre-Configurated Package: This package is intended for most users. It is designed to work well with most packages, and does not require any extra libraries for compiling.

Compiled from Source: This package is meant for systems with very customized options. Most importantly, either a custom kernel or custom x-servers/system commands. It is for the more experienced user, but is much more likely to fit any setup, as it is compiled to your system's specs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.