Subject: [UFL-dev] ImportError: cannot import name exproperators

From: Anders Logg <[email-masked]>
Date: Sun, 22 Feb 2009 22:41:20 +0100

Often when there is a small mistake like missing parantheses etc, I
get

  ImportError: cannot import name exproperators

instead of an informative message of what's really wrong. Is there a
reason for this? It makes debugging difficult.

-- 
Anders

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Mon, 23 Feb 2009 09:55:27 +0100

Do you have an example? I've never encountered that issue.

Martin

On Sun, Feb 22, 2009 at 10:41 PM, Anders Logg <[email-masked]> wrote:
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkmhxoAACgkQTuwUCDsYZdFABACfUwRuwKbd9sThO+CsNmg6yRay
> dywAoIQW0AZz2NsJal8x6W9OgldqSh9g
> =7H3O
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> UFL-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/ufl-dev
>
>

---

From: Anders Logg <[email-masked]>
Date: Mon, 23 Feb 2009 17:44:14 +0100

> Do you have an example? I've never encountered that issue.

Try for example changing the first line in renumbering.py to

from ufl.common import Countedx
                              ~
-- 
Anders

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Mon, 23 Feb 2009 18:17:24 +0100

No problem here:
...
  File "/usr/lib/python2.5/site-packages/ufl/algorithms/renumbering.py",
line 4, in <module>
    from ufl.common import Countedx
ImportError: cannot import name Countedx

Martin

On Mon, Feb 23, 2009 at 5:44 PM, Anders Logg <[email-masked]> wrote:
> iEYEARECAAYFAkmi0l4ACgkQTuwUCDsYZdEkegCfdwlFByxqYGziRfYoebc+b6Eh
> 3c4AnRCkveZ66QhubSMzuoos3j0sQ4xJ
> =QeWB

---

From: Martin Sandve Alnæs <[email-masked]>
Date: Mon, 23 Feb 2009 18:37:39 +0100

Maybe it has something to do with "semi-circular" dependencies a
couple of places, where "from ufl.something import something" is
executed runtime.

Try this line to discover the places this is done:
for f in *.py; do echo === $f; egrep \\\ from\\\ \.\*\\\ import $f; done

I changed the "from ufl import exproperators as __exproperators"
to "import ufl.exproperators as __exproperators" in __init__.py,
see if that helps. Just a random thought, don't know why :-/

Martin

On Mon, Feb 23, 2009 at 6:17 PM, Martin Sandve Alnæs <[email-masked]> wrote:
> - Show quoted text -

---

From: Anders Logg <[email-masked]>
Date: Mon, 23 Feb 2009 21:02:51 +0100

You are right. This seems to be a circular dependency, but in FFC
rather than UFL. I haven't been able to track it down yet but it looks
to be somewhere in the JIT compiler.

-- 
Anders