That doesn't seem to work. (I haven't tried to figure out what the problem
is, and I think I'm going to sleep soon instead of trying to figure it out
right now.)

I think that it doesn't do the imports, but then later it tries to use them.

bober@sage:~$ MPMATH_NOSAGE=1 sage -python -c "import mpmath"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File
"/usr/local/sage/local/lib/python2.6/site-packages/mpmath/__init__.py",
line 6, in <module>
    from .ctx_mp import MPContext
  File
"/usr/local/sage/local/lib/python2.6/site-packages/mpmath/ctx_mp.py", line
48, in <module>
    from sage.libs.mpmath.ext_main import Context as BaseMPContext
  File "integer.pxd", line 9, in init sage.libs.mpmath.ext_main
(sage/libs/mpmath/ext_main.c:25047)
  File "integer.pyx", line 170, in init sage.rings.integer
(sage/rings/integer.c:35083)
  File
"/usr/local/sage/local/lib/python2.6/site-packages/sage/rings/infinity.py",
line 200, in <module>
    import sage.rings.rational
  File "fast_arith.pxd", line 3, in init sage.rings.rational
(sage/rings/rational.c:25448)
  File "fast_arith.pyx", line 51, in init sage.rings.fast_arith
(sage/rings/fast_arith.c:7557)
  File "integer_ring.pyx", line 69, in init sage.rings.integer_ring
(sage/rings/integer_ring.c:11070)
  File
"/usr/local/sage/local/lib/python2.6/site-packages/sage/structure/factorization.py",
line 189, in <module>
    from sage.misc.all import prod
  File
"/usr/local/sage/local/lib/python2.6/site-packages/sage/misc/all.py", line
81, in <module>
    from functional import (additive_order,
  File
"/usr/local/sage/local/lib/python2.6/site-packages/sage/misc/functional.py",
line 36, in <module>
    from sage.rings.complex_double import CDF
  File "complex_double.pyx", line 88, in init sage.rings.complex_double
(sage/rings/complex_double.c:14778)
  File "real_mpfr.pxd", line 15, in init sage.rings.complex_number
(sage/rings/complex_number.c:16186)
  File "real_mpfr.pyx", line 1, in init sage.rings.real_mpfr
(sage/rings/real_mpfr.c:29953)
  File "utils.pyx", line 11, in init sage.libs.mpmath.utils
(sage/libs/mpmath/utils.c:5951)
  File "/usr/local/sage/local/lib/python2.6/site-packages/sage/all.py",
line 72, in <module>
    from sage.libs.all       import *
  File
"/usr/local/sage/local/lib/python2.6/site-packages/sage/libs/all.py", line
1, in <module>
    import sage.libs.ntl.all  as ntl
  File
"/usr/local/sage/local/lib/python2.6/site-packages/sage/libs/ntl/all.py",
line 26, in <module>
    from sage.libs.ntl.ntl_ZZ import (
  File "ntl_ZZ.pyx", line 28, in init sage.libs.ntl.ntl_ZZ
(sage/libs/ntl/ntl_ZZ.cpp:6238)
  File "integer_ring.pyx", line 1063, in
sage.rings.integer_ring.IntegerRing (sage/rings/integer_ring.c:9618)
NameError: ZZ


On Tue, Dec 13, 2011 at 2:35 AM, Fredrik Johansson <
fredrik.johans...@gmail.com> wrote:

> On Tue, Dec 13, 2011 at 8:27 AM, Jonathan Bober <jwbo...@gmail.com> wrote:
> > Does anyone happen to know why this happens? I have a feeling it is
> going to
> > annoy my sometime soon.
>
> You can prevent mpmath from trying to import Sage altogether by
> setting the MPMATH_NOSAGE environment variable. Of course, this makes
> the runtime a bit slower.
>
> Right now mpmath imports sage.all but only uses sage.Integer,
> sage.factorial, sage.fibonacci and sage.primes. I suppose the last
> three imports could be done lazily. But it definitely needs to import
> the Sage Integer type at startup or not at all.
>
> Fredrik
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to