all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David De La Harpe Golden <david@harpegolden.net>
To: Alan Mackenzie <acm@muc.de>
Cc: Andreas Schwab <schwab@linux-m68k.org>, emacs-devel@gnu.org
Subject: Re: 'bzr init-repo .' crashes for lack of module bz2.  Help, please!
Date: Thu, 31 Dec 2009 17:04:41 +0000	[thread overview]
Message-ID: <4B3CD9A9.9030705@harpegolden.net> (raw)
In-Reply-To: <20091231120648.GA2801@muc.de>

Alan Mackenzie wrote:
> Hi, David,
> 
> On Tue, Dec 29, 2009 at 11:49:15PM +0000, David De La Harpe Golden wrote:
>> Alan Mackenzie wrote:
>>> On Tue, Dec 29, 2009 at 09:19:06PM +0100, Andreas Schwab wrote:
>>>> Alan Mackenzie <acm@muc.de> writes:
> 
>>>>> The sole "necessary bit" for bz2 appears to be bz2module.c, which
>>>>> exists in the Python source tree.  It appears not to have been
>>>>> compiled (there is no bz2module.o).  There is nothing else helpful
>>>>> in the build procedure's stdout or stderr.  Any ideas?
> 
>>>> Most likely you lack bzip2.
> 
>>> No, I have bzip2 (used it this morning on the Python tarball),
>>> including, in particular, /usr/lib/libbz2.so.1.0.2 (with an
>>> appropriate symlink with a truncated name).
> 
>> Just in case: and the relevant bz2 header /usr/include/bzlib.h  ?
>> Would probably be in package libbz2-dev in debian.
> 
> I was lacking this file, so I downloaded and built the latest version of
> bzip2. 

And rebuild python against this version, right, with "bz2" absent from
the list of modules that failed to build this time due to failure to 
"find the necessary bits"? Does the "python" to
get a python repl then "import bz2" test succeed now?

Maybe there's a way to turn on more verbosity during python
building.  I can see the relevant bundled extension module building 
during python "make" output as follows:

...
building 'bz2' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -I. -I/usr/local/src/Python-2.6.4/./Include -I. 
-IInclude -I./Include -I/usr/local/include 
-I/usr/local/src/Python-2.6.4/Include -I/usr/local/src/Python-2.6.4 -c 
/usr/local/src/Python-2.6.4/Modules/bz2module.c -o 
build/temp.linux-x86_64-2.6/usr/local/src/Python-2.6.4/Modules/bz2module.o
gcc -pthread -shared 
build/temp.linux-x86_64-2.6/usr/local/src/Python-2.6.4/Modules/bz2module.o 
-L/usr/local/lib -lbz2 -o build/lib.linux-x86_64-2.6/bz2.so
building 'pyexpat' extension
...


> I still get the same error message, which I don't understand,
> namely:
> 
>     bzr: ERROR: exceptions.ImportError: failed to load bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a: No module named bz2
> 
> Presumably "bzrlib.repofmt.groupcompress_repo" means the file
> .../bzrlib/repofmt/groupcompress_repo.py, but what, exactly, is a "module
> named bz2"? 

In this case, it means a python extension "module" being a python 
binding to libbz2 (*).  Such extensions are atypical python modules 
implemented as C libs rather than python. The C code uses the python C 
implementation's ("cpython") C API to act like a python module to python 
code running under that implementation, providing additional 
python-callable functions and python-usable data types.  It's actually a 
pretty typical way of extending scripting languages implemented in C, 
though python has now also introduced the more Lisp-conventional "FFI" 
approach for such things in module "ctypes" (just mentioning for 
completeness).
http://docs.python.org/extending/index.html
http://docs.python.org/library/ctypes.html

(*) bzr is presumably using bzip2 compression internally.

 > What is its filename, where is bzr (or Python?) looking for
> it?
> 

python is looking for it, in the python module search path probably, 
since it's not finding the extension module bz2.  But it's IMO pretty
definitely the normal python-bundled extension module bz2 you need.

On a successful python installation, it'll probably be somewhere
like
/usr/local/lib/python2.6/lib-dynload/bz2.so












  reply	other threads:[~2009-12-31 17:04 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-28 17:04 'bzr init-repo .' crashes for lack of module bz2. Help, please! Alan Mackenzie
2009-12-28 21:14 ` Karl Fogel
2009-12-28 23:05 ` David De La Harpe Golden
2009-12-29 20:08   ` Alan Mackenzie
2009-12-29 20:19     ` Andreas Schwab
2009-12-29 20:57       ` Alan Mackenzie
2009-12-29 23:49         ` David De La Harpe Golden
2009-12-31 12:06           ` Alan Mackenzie
2009-12-31 17:04             ` David De La Harpe Golden [this message]
2010-01-03 17:33               ` Alan Mackenzie
2010-01-03 18:16                 ` Tassilo Horn
2010-01-03 21:56                   ` Alan Mackenzie
2010-01-04  0:06                     ` Miles Bader
2010-01-04  0:13                       ` Jason Rumney
2010-01-06 13:30                         ` Alan Mackenzie
2010-01-04  8:16                     ` Tassilo Horn
2010-01-04 16:23                       ` Richard Stallman
2010-01-04 20:42                         ` Gentoo GNU/Linux and non-free packages (was: 'bzr init-repo .' crashes for lack of module bz2. Help, please!) Tassilo Horn
2010-01-05  9:03                           ` Gentoo GNU/Linux and non-free packages Ulrich Mueller
2010-01-05 20:45                             ` Richard Stallman
2010-01-05 20:45                           ` Gentoo GNU/Linux and non-free packages (was: 'bzr init-repo .' crashes for lack of module bz2. Help, please!) Richard Stallman
2010-01-06  0:10                             ` Jonas Bernoulli
2010-01-06 20:45                               ` Richard Stallman
2010-01-07  8:35                                 ` Gentoo GNU/Linux and non-free packages Tassilo Horn
2010-01-07 22:49                                   ` Richard Stallman
2010-01-08  0:06                                     ` Marek Aaron Sapota
2010-01-08  9:30                                       ` Tassilo Horn
2010-01-08 11:20                                         ` Marek Aaron Sapota
     [not found]                                         ` <20100108111454.GC1426@fencepost.localnet>
2010-01-08 11:56                                           ` Tassilo Horn
2010-01-08 12:44                                             ` Marek Aaron Sapota
2010-01-08 14:44                                               ` Tassilo Horn
2010-01-08 15:47                                                 ` Marek Aaron Sapota
2010-01-08 15:23                                         ` Yavor Doganov
2010-01-08 15:57                                           ` Marek Aaron Sapota
2010-01-08 16:23                                             ` Tassilo Horn
2010-01-08 16:46                                               ` David Kastrup
2010-01-08  8:56                                     ` Tassilo Horn
2010-01-08 23:01                                       ` Richard Stallman
2010-01-06  7:35                             ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B3CD9A9.9030705@harpegolden.net \
    --to=david@harpegolden.net \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.