Cannot find module grep
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bzr-grep |
Fix Released
|
High
|
Jelmer Vernooij |
Bug Description
I tried getting bzr-grep working with bzr 2.5. Following the instructions in the INSTALL file, I moved the directory to the plugins directory (renamed as grep).
bzr help grep works fine, so the files are in place.
However, actually trying to use the command causes this error:
bzr: ERROR: No module named grep
You may need to install this Python library separately.
I think this is caused by using lazy_import to get the grep module when it isn't a system module. It's a file in the plugin. I moved the import grep line in __init__.py outside the lazy_import call and all seems to be working now.
Prior to my change, bzr log gave this traceback:
0.083 looking for plugins in /usr/lib/
0.114 encoding stdout as sys.stdout encoding 'UTF-8'
0.115 Transferred: 0kB (0.0kB/s r:0kB w:0kB)
0.131 Traceback (most recent call last):
File "/usr/lib/
return the_callable(*args, **kwargs)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
return self._operation
File "/usr/lib/
self.cleanups, self.func, *args, **kwargs)
File "/usr/lib/
result = func(*args, **kwargs)
File "/usr/lib/
result = func(*args, **kwargs)
File "/usr/lib/
if not ignore_case and grep.is_
File "/usr/lib/
obj = object.
File "/usr/lib/
obj = factory(self, scope, name)
File "/usr/lib/
module = __import_
ImportError: No module named grep
0.131 return code 3
Changed in bzr-grep: | |
status: | Fix Committed → Fix Released |
What version of bzr-grep are you trying? For bzr 2.5 you need the fix for relative imports from r147.