Why does bzr keep saying "cannot import name SPEC_TYPES"?

Asked by Matthew Paul Thomas on 2011-09-21

I'm using bzr 2.4.1-1ubuntu1 on Ubuntu 11.10 beta.

Every bzr command I enter, before it starts, it says "cannot import name SPEC_TYPES".

For example:
------------
13:19:36@trunk> bzr st
cannot import name SPEC_TYPES
unknown:
  diff
------------

Why?

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Matthew Paul Thomas
Solved:
2011-10-19
Last query:
2011-10-19
Last reply:
2011-09-21
Jelmer Vernooij (jelmer) said : #1

On 09/21/2011 02:25 PM, Matthew Paul Thomas wrote:
> New question #171893 on Bazaar:
> https://answers.launchpad.net/bzr/+question/171893
>
> I'm using bzr 2.4.1-1ubuntu1 on Ubuntu 11.10 beta.
>
> Every bzr command I enter, before it starts, it says "cannot import name SPEC_TYPES".
>
> For example:
> ------------
> 13:19:36@trunk> bzr st
> cannot import name SPEC_TYPES
> unknown:
> diff
> ------------
>
> Why?
I suspect one of the plugins you have installed is trying to import
something that (no longer?) exists. ~/.bzr.log should have more information.

We try to display a warning if a plugin failed to load, so I wonder why
we're not doing that here.

Cheers,

Jelmer

Matthew Paul Thomas (mpt) said : #2

Here's the end of ~/.bzr.log:
------------
2.007 Deprecated method called
Called from:
  File "<string>", line 1, in <module>
  File "/home/mpt/.bazaar/plugins/loom/__init__.py", line 60, in <module>
    import branch
  File "/home/mpt/.bazaar/plugins/loom/branch.py", line 777, in <module>
    bzrlib.branch.BranchFormat.register_format(BzrBranchLoomFormat6())
  File "/usr/lib/python2.7/dist-packages/bzrlib/symbol_versioning.py", line 135, in decorated_method
    trace.mutter_callsite(4, "Deprecated method called")
[ 6190] 2011-10-19 21:15:02.347 WARNING: cannot import name SPEC_TYPES
2.033 Unable to load plugin 'loom' from '/home/mpt/.bazaar/plugins'
2.052 Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugin.py", line 380, in _load_plugin_module
    exec "import bzrlib.plugins.%s" % name in {}
  File "<string>", line 1, in <module>
  File "/home/mpt/.bazaar/plugins/loom/__init__.py", line 62, in <module>
    import revspec
  File "/home/mpt/.bazaar/plugins/loom/revspec.py", line 22, in <module>
    from bzrlib.revisionspec import SPEC_TYPES, RevisionSpec, RevisionInfo
ImportError: cannot import name SPEC_TYPES
------------

It looks like I had an old manually-downloaded copy of bzr-loom. I've now removed it and installed Ubuntu's packaged bzr-loom, and the warning has gone away. Thanks!

Martin Pool (mbp) said : #3

I believe there's a bug open saying that on ImportError or AttributeError we should suggest it is likely (not certain) they have a version mismatch or installation problem.

John A Meinel (jameinel) said : #4

We used to be more verbose during broken plugin imports. Then we stopped
because some would break a lot. I think we are stable enough that we could
go back to more verbose failures when importing plugins.

Arguably the nice thing would be a way to say, okay don't show me that
anymore. We do have BZR_DISABLE_PLUGINS, though.

John
=:->
On Oct 20, 2011 3:17 AM, "Martin Pool" <email address hidden>
wrote:

> Question #171893 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/171893
>
> Martin Pool posted a new comment:
> I believe there's a bug open saying that on ImportError or
> AttributeError we should suggest it is likely (not certain) they have a
> version mismatch or installation problem.
>
> --
> You received this question notification because you are an answer
> contact for Bazaar.
>