bzr: ERROR: Couldn't import bzrlib and dependencies.
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-
"""
% bzr get --no-tree lp:~sirex/django-currencies/devel /home/sirex/
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?
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.