bzr: ERROR: Couldn't import bzrlib and dependencies.

Bug #684120 reported by Mantas Zimnickas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gf.recipe.bzr
Invalid
Undecided
Unassigned

Bug Description

I use Ubuntu 10.04 with system wide installed bzr 2.1.1

But if I user gf.recipe.bzr to branch a repo, getting this error:

django-currencies: Error calling bazaar in "django-currencies", detailed output follows:
"""
% bzr get --no-tree lp:~sirex/django-currencies/devel /home/sirex/devel/wora/parts/django-currencies/django-currencies

bzr: ERROR: Couldn't import bzrlib and dependencies.
Please check the directory containing bzrlib is on your PYTHONPATH.

Traceback (most recent call last):
  File "/usr/bin/bzr", line 107, in <module>
    import bzrlib
ImportError: No module named bzrlib
"""
While:
  Installing django-currencies.
Error: Error calling bzr

It I repeat outputed brz command by hand, it works. Also I checked, that bin/buildout runs with python -S. So maybe same applies to bzr command, that is run by Popen?

Revision history for this message
Balazs Ree (ree) wrote :

I have a hint what may cause this.

It seems that buildout (not sure if always, or just in some cases, or just recently) tries to force its own PYTHONPATH to any python executable run from it, this even has an effect if - like bzr - we want to run a separately installed application that brings its own python and libs.

This is clearly a problem in the case of any application like bzr, that needs to import modules, which won't be present if buildout forces its path.

Could you please put a pdb breakpoint before the import statement that fails, and print out sys.path? Then, run bzr by hand and print out sys.path in that case?

If there is a difference than buildout's behaviour is the problem. In this case we could probably solve this problem by resetting PYTHONPATH before running bzr (and we don't have to raise an argument with the buildout developers about the issue)

-S _may_ also be a problem, as you mention.

Revision history for this message
Mantas Zimnickas (sirex) wrote :

Strange, after clearing all files generated by buildout, and bootstrapping everything again, this error disappeared, so now I can't reproduce it.

Maybe there was some thing with my buildout environment. Also I always run buildout with -N flag, but now, for testing I removed -N, so some packages was upgraded, maybe this also fixes problem.

Changed in gf.recipe.bzr:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.