Issue 235 in mpmath: troubles using gmpy with mpmath

5 views
Skip to first unread message

mpm...@googlecode.com

unread,
Mar 15, 2013, 7:07:10 AM3/15/13
to mpmath...@googlegroups.com
Status: New
Owner: ----

New issue 235 by gbeli...@gmail.com: troubles using gmpy with mpmath
http://code.google.com/p/mpmath/issues/detail?id=235




What steps will reproduce the problem?
1. I installed gmplib 5.1.0, mpfr 3.1.1, mpc 1.0.1, GMPY2 2.0.0b3 full
source.
2. configured and make, make install all of these. The tests were OK.
3. I ran my script:

m=2
import os
from mpmath import *
mp.dps=1000
zetazeroval=zetazero(m)


What is the expected output? What do you see instead?
Reported an error

File "zetazero.py", line 12, in <module>
zetazeroval=zetazero(m)
File "/usr/lib/python2.7/site-packages/mpmath/functions/zetazeros.py",
line 394, in zetazero
find_rosser_block_zero(ctx, n)

...
File "/usr/lib/python2.7/site-packages/mpmath/libmp/libelefun.py", line
101, in g
return f.memo_val >> (newprec-prec)
TypeError: unsupported operand type(s) for >>: 'mpfr' and 'int'


The same error was reported at many places when I ran
import mpmath
mpmath.runtests()

File "/usr/lib/python2.7/site-packages/mpmath/libmp/libelefun.py", line
97, in g
return f.memo_val >> (memo_prec-prec)
TypeError: unsupported operand type(s) for >>: 'mpfr' and 'int'

half the tests were passed

What version of the product are you using? On what operating system?
Fedora 16, python 2.7
gmplib 5.1.0, mpfr 3.1.1, mpc 1.0.1, GMPY2 2.0.0b3

mpmath.__version__
'0.17'
mpmath.libmp.BACKEND
'gmpy'


Please provide any additional information below.

Without gmpy calculations went fine


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

mpm...@googlecode.com

unread,
Mar 15, 2013, 7:37:25 AM3/15/13
to mpmath...@googlegroups.com

Comment #1 on issue 235 by fredrik....@gmail.com: troubles using gmpy with
mpmath
http://code.google.com/p/mpmath/issues/detail?id=235

Can you check if this problem persists with gmpy2 2.0.0b4 (or the gmpy
trunk)?

mpm...@googlecode.com

unread,
Mar 15, 2013, 8:12:54 AM3/15/13
to mpmath...@googlegroups.com

Comment #2 on issue 235 by gbeli...@gmail.com: troubles using gmpy with
mpmath
http://code.google.com/p/mpmath/issues/detail?id=235

I am afraid the problem persists

mpm...@googlecode.com

unread,
Mar 15, 2013, 10:25:10 AM3/15/13
to mpmath...@googlegroups.com

Comment #3 on issue 235 by gbeli...@gmail.com: troubles using gmpy with
mpmath
http://code.google.com/p/mpmath/issues/detail?id=235

Our administrator tried to install gmpy2 after mpmath, (on CentoOS) and
mpmath stopped working:

>>> import mpmath
Traceback (most recent call last):
File "<stdin>", line 1, in <module>

File "/usr/local/python/2.7.1-gcc/lib/python2.7/site-packages/mpmath/__init__.py",
line 5, in <module>
from .ctx_fp import FPContext

File "/usr/local/python/2.7.1-gcc/lib/python2.7/site-packages/mpmath/ctx_fp.py",
line 1, in <module>
from .ctx_base import StandardBaseContext

File "/usr/local/python/2.7.1-gcc/lib/python2.7/site-packages/mpmath/ctx_base.py",
line 3, in <module>
from .libmp.backend import xrange

File "/usr/local/python/2.7.1-gcc/lib/python2.7/site-packages/mpmath/libmp/__init__.py",
line 1, in <module>
from .libmpf import (prec_to_dps, dps_to_prec, repr_dps,

File "/usr/local/python/2.7.1-gcc/lib/python2.7/site-packages/mpmath/libmp/libmpf.py",
line 20, in <module>
from .libintmath import (giant_steps,

File "/usr/local/python/2.7.1-gcc/lib/python2.7/site-packages/mpmath/libmp/libintmath.py",
line 302, in <module>
sqrtrem = gmpy.sqrtrem
AttributeError: 'module' object has no attribute 'sqrtrem'

it has gmp/5.1.0 and mpfr 3.1.1

mpm...@googlecode.com

unread,
Mar 15, 2013, 11:23:16 AM3/15/13
to mpmath...@googlegroups.com

Comment #4 on issue 235 by fredrik....@gmail.com: troubles using gmpy with
mpmath
http://code.google.com/p/mpmath/issues/detail?id=235

Thanks. I will investigate.

mpm...@googlecode.com

unread,
Mar 15, 2013, 1:56:11 PM3/15/13
to mpmath...@googlegroups.com

Comment #5 on issue 235 by fredrik....@gmail.com: troubles using gmpy with
mpmath
http://code.google.com/p/mpmath/issues/detail?id=235

Ah, this should already be fixed in the git repository.

Can you check if a source checkout
https://github.com/fredrik-johansson/mpmath works?

mpm...@googlecode.com

unread,
Mar 16, 2013, 9:21:27 AM3/16/13
to mpmath...@googlegroups.com

Comment #6 on issue 235 by gbeli...@gmail.com: troubles using gmpy with
mpmath
http://code.google.com/p/mpmath/issues/detail?id=235

After I got the code from git, it seems to have fixed the problem
Thanks!
Reply all
Reply to author
Forward
0 new messages