New issue 215 by paulo.ce...@gmail.com: python-mpmath fails if sage
packages installed
http://code.google.com/p/mpmath/issues/detail?id=215
Example of execution:
$ rpm -q sagemath
sagemath-4.7.2-2-mdv2012.0.x86_64
$ export MPMATH_NOSAGE=1
$ python
Python 2.7.2 (default, Aug 30 2011, 03:39:21)
[GCC 4.6.1 20110826 (Mandriva)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mpmath
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/mpmath/__init__.py", line 6, in
<module>
from .ctx_mp import MPContext
File "/usr/lib/python2.7/site-packages/mpmath/ctx_mp.py", line 48, in
<module>
from sage.libs.mpmath.ext_main import Context as BaseMPContext
File "parent.pxd", line 11, in init sage.libs.mpmath.ext_main
(sage/libs/mpmath/ext_main.c:24996)
File "element.pxd", line 12, in init sage.structure.parent
(sage/structure/parent.c:21563)
File "element.pyx", line 184, in init sage.structure.element
(sage/structure/element.c:28577)
File "/usr/lib64/python2.7/site-packages/sage/misc/sageinspect.py", line
161, in <module>
SAGE_ROOT = os.environ["SAGE_ROOT"]
File "/usr/lib64/python2.7/UserDict.py", line 23, in __getitem__
raise KeyError(key)
KeyError: 'SAGE_ROOT'
I think it should need some different machinery to know if
should or not attempt to load sage modules.
MPMATH_NOSAGE=1 *should* be fixed already in the svn version of mpmath. Can
you verify this?
Yes, I confirm it is fixed. Actually, it appears to work
regardless of setting or not MPMATH_NOSAGE=1 when
sage is installed.