* [gentoo-science] [sage-on-gentoo]some strange problem with sympy
@ 2010-10-17 10:27 François Bissey
2010-10-17 21:39 ` François Bissey
0 siblings, 1 reply; 4+ messages in thread
From: François Bissey @ 2010-10-17 10:27 UTC (permalink / raw
To: gentoo-science
Hi all,
I was looking at splitting mpmath from sympy (with the help of the patches
from fedora) when I came across this at test time:
ebuild sympy-0.6.6.ebuild install
>>> Existing ${T}/environment for 'sympy-0.6.6' will be sourced. Run
>>> 'clean' to start with a fresh environment.
* sympy-0.6.6.tar.gz RMD160 SHA1 SHA256 size ;-) ...
[ ok ]
* checking ebuild checksums ;-) ...
[ ok ]
* checking auxfile checksums ;-) ...
[ ok ]
* checking miscfile checksums ;-) ...
[ ok ]
* checking sympy-0.6.6.tar.gz ;-) ...
[ ok ]
* Package: dev-python/sympy-0.6.6
* Repository: sage
* Maintainer: grozin@gentoo.org sci-mathematics@gentoo.org
* USE: elibc_glibc gtk ipython kernel_linux latex mathml opengl pdf png
userland_GNU x86
>>> It appears that 'sympy-0.6.6' is already setup; skipping.
>>> Remove '/var/tmp/portage/dev-python/sympy-0.6.6/.setuped' to force setup.
>>> Checking sympy-0.6.6.tar.gz's mtime...
>>> WORKDIR is up-to-date, keeping...
>>> It appears that 'sympy-0.6.6' is already prepared; skipping.
>>> Remove '/var/tmp/portage/dev-python/sympy-0.6.6/.prepared' to force
prepare.
>>> Configuring source in /var/tmp/portage/dev-
python/sympy-0.6.6/work/sympy-0.6.6 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-
python/sympy-0.6.6/work/sympy-0.6.6 ...
python2.6 setup.py build
Setting permissions of DOT_SAGE directory so only you can read and write it.
Traceback (most recent call last):
File "/usr/bin/sage-cleaner", line 25, in <module>
DOT_SAGE = os.environ['DOT_SAGE']
File "/usr/lib/python2.6/UserDict.py", line 22, in __getitem__
raise KeyError(key)
KeyError: 'DOT_SAGE'
Traceback (most recent call last):
File "/usr/bin/sage-cleaner", line 25, in <module>
DOT_SAGE = os.environ['DOT_SAGE']
File "/usr/lib/python2.6/UserDict.py", line 22, in __getitem__
raise KeyError(key)
KeyError: 'DOT_SAGE'
I get the same thing with sympy-0.6.7 from portage. I guess it only happens
when sage is already present so it would not be visible from a clean install
of sage. That sage being installed seem to have an influence on sympy further
merging is worrying. Some more packages could be affected (I tested mpmath
and there is no problem there).
Anyone else sees this?
This is with portage-2.2-rc97 that may have an influence.
Any idea for debuging this problem should it be real? ebuild --debug wasn't
helpful, I would need to run "python2.6 setup.py build -b build-2.6" with some
debug output.
Cheers,
Francois
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-science] [sage-on-gentoo]some strange problem with sympy
2010-10-17 10:27 [gentoo-science] [sage-on-gentoo]some strange problem with sympy François Bissey
@ 2010-10-17 21:39 ` François Bissey
2010-10-17 23:42 ` Steven Trogdon
0 siblings, 1 reply; 4+ messages in thread
From: François Bissey @ 2010-10-17 21:39 UTC (permalink / raw
To: gentoo-science
Hi,
I think I found the root cause of the problem. sympy's setup.py
has the following line:
import sympy
it is the line triggering everything. I don't know if it calls the already
installed system sympy or the build copy (but I could find out).
The matter is it is reproducible by just opening a python2.6 shell
and typing "import sympy" and you will get the same message.
Try "import mpmath" and you will get the exact same error. This is
because the problem comes from mpmath and in the case of sympy
the copy of mpmath that is shipped with it.
mpmath ships a file which will try to load sage: libintmath.py, it also
tries to load gmpy if it is available. I don't know if that gives rise to
similar problems:
import math
from bisect import bisect
from settings import MODE, gmpy, sage, MP_BASE, MP_ONE, MP_ZERO
So we have to look in settings.py :
gmpy = None
sage = None
MODE = 'python'
MP_BASE = long
if 'MPMATH_NOGMPY' not in os.environ:
try:
import gmpy
if gmpy.version() >= '1.03':
MODE = 'gmpy'
MP_BASE = gmpy.mpz
except:
pass
if 'MPMATH_NOSAGE' not in os.environ:
try:
import sage.all
if hasattr(sage.all.Integer, "trailing_zero_bits"):
sage = sage.all
MODE = 'sage'
MP_BASE = sage.Integer
except:
pass
-----------------------------
This is all a little bit convoluted mpmath is used by sage and now it looks
like mpmath can use sage.
Anyway exporting MPMATH_NOSAGE=1 in the ebuild should solve that particular
problem.
Francois
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-science] [sage-on-gentoo]some strange problem with sympy
2010-10-17 21:39 ` François Bissey
@ 2010-10-17 23:42 ` Steven Trogdon
2010-10-18 7:54 ` François Bissey
0 siblings, 1 reply; 4+ messages in thread
From: Steven Trogdon @ 2010-10-17 23:42 UTC (permalink / raw
To: gentoo-science
[-- Attachment #1: Type: text/plain, Size: 976 bytes --]
François,
On 10/17/2010 04:39:12 PM, François Bissey wrote:
> Hi,
>
> I think I found the root cause of the problem. sympy's setup.py
> has the following line:
>
> import sympy
>
> it is the line triggering everything. I don't know if it calls the already
> installed system sympy or the build copy (but I could find out).
> The matter is it is reproducible by just opening a python2.6 shell
> and typing "import sympy" and you will get the same message.
> Try "import mpmath" and you will get the exact same error. This is
> because the problem comes from mpmath and in the case of sympy
> the copy of mpmath that is shipped with it.
>
Here I get the
KeyError: 'DOT_SAGE'
when I import sympy from a python shell on a machine where sage-4.6.alpha3 is
installed but not from one where sage-4.5.3 is installed. However,
installs of 4.6.alpha3 and 4.5.3 both exhibit the error when
ebuild sympy-0.6.6.build compile
is issued.
Steve
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-science] [sage-on-gentoo]some strange problem with sympy
2010-10-17 23:42 ` Steven Trogdon
@ 2010-10-18 7:54 ` François Bissey
0 siblings, 0 replies; 4+ messages in thread
From: François Bissey @ 2010-10-18 7:54 UTC (permalink / raw
To: gentoo-science
> François,
>
> On 10/17/2010 04:39:12 PM, François Bissey wrote:
> > Hi,
> >
> > I think I found the root cause of the problem. sympy's setup.py
> > has the following line:
> >
> > import sympy
> >
> > it is the line triggering everything. I don't know if it calls the
> > already installed system sympy or the build copy (but I could find out).
> > The matter is it is reproducible by just opening a python2.6 shell and
> > typing "import sympy" and you will get the same message.
> > Try "import mpmath" and you will get the exact same error. This is
> > because the problem comes from mpmath and in the case of sympy
> > the copy of mpmath that is shipped with it.
>
> Here I get the
>
> KeyError: 'DOT_SAGE'
>
> when I import sympy from a python shell on a machine where sage-4.6.alpha3
> is installed but not from one where sage-4.5.3 is installed. However,
>
That's interesting Steve! That may be due to a change in sage-4.6.
Can you try "import sage.all" on the machine with sage-4.5.3?
I was going to email to both sympy and mpmath mailing list but that's
something I'd like to know before raising the issue on mpmath.
I think the "import sympy" in setup.py is wrong in any case.
Francois
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-18 7:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-17 10:27 [gentoo-science] [sage-on-gentoo]some strange problem with sympy François Bissey
2010-10-17 21:39 ` François Bissey
2010-10-17 23:42 ` Steven Trogdon
2010-10-18 7:54 ` François Bissey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox