Windows, 0.7.6, fourier_transform error

37 views
Skip to first unread message

Colin Macdonald

unread,
Nov 23, 2014, 6:32:45 PM11/23/14
to sy...@googlegroups.com
Hi,

Can someone test this on Windows with 0.7.6?

````
x,k = symbols('x,k')
f = exp(-x*x)
fourier_transform(f,x,k)
````
(and report what Python you use).

Windows is (thankfully) not my main platform but I've been testing some
stuff. I run py.exe (a single-exe-file stand-alone python 2.7.8) which
works great with SymPy 0.7.5. But on SymPy 0.7.6, I get the following,
at least with the Fourier command above. Some other commands in my test
set cause errors too, but haven't narrowed them down yet (due to
combination of an Octave bug and my inability to do much on Windows).

````
N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.2\bin>py
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from sympy import *
>>> x,k = symbols('x,k')
>>> f = exp(-x*x)
>>> fourier_transform(f,x,k)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "sympy\integrals\transforms.py", line 1364, in fourier_transform
File "sympy\integrals\transforms.py", line 118, in doit
File "sympy\integrals\transforms.py", line 1307, in _compute_transform
File "sympy\integrals\transforms.py", line 196, in wrapper
File "sympy\integrals\transforms.py", line 1284, in _fourier_transform
File "sympy\utilities\decorator.py", line 35, in threaded_func
File "sympy\integrals\integrals.py", line 1232, in integrate
File "sympy\integrals\integrals.py", line 467, in doit
File "sympy\integrals\integrals.py", line 444, in try_meijerg
File "sympy\integrals\meijerint.py", line 1746, in meijerint_definite
File "sympy\integrals\meijerint.py", line 1855, in _meijerint_definite_2
File "sympy\integrals\meijerint.py", line 1867, in _meijerint_definite_3
File "sympy\integrals\meijerint.py", line 1932, in _meijerint_definite_4
File "sympy\integrals\meijerint.py", line 898, in _rewrite_saxena
File "sympy\integrals\meijerint.py", line 874, in pb
File "sympy\functions\special\hyper.py", line 578, in get_period
File "sympy\functions\special\hyper.py", line 575, in compute
File "sympy\core\expr.py", line 2922, in simplify
File "sympy\simplify\simplify.py", line 3671, in simplify
File "sympy\vector\__init__.py", line 1, in <module>
File "sympy\vector\vector.py", line 6, in <module>
File "sympy\vector\basisdependent.py", line 9, in <module>
File "sympy\vector\basisdependent.py", line 70, in BasisDependent
````

--
Colin Macdonald
Associate Professor
Tutorial Fellow at Oriel College
University of Oxford
0xC5326EE5.asc
signature.asc

Aaron Meurer

unread,
Nov 24, 2014, 3:32:43 AM11/24/14
to sy...@googlegroups.com
Did it not say what the exception was?

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/54726E92.5070003%40maths.ox.ac.uk.
> For more options, visit https://groups.google.com/d/optout.

Colin Macdonald

unread,
Nov 24, 2014, 4:18:41 AM11/24/14
to sy...@googlegroups.com
On 24/11/14 08:32, Aaron Meurer wrote:
> Did it not say what the exception was?

No :( I was hoping to confirm whether it was a local issue or a general
0.7.6-on-windows problem before I tried to dig further.
0xC5326EE5.asc
signature.asc

Colin Macdonald

unread,
Nov 24, 2014, 4:51:09 AM11/24/14
to sy...@googlegroups.com
On 24/11/14 09:18, Colin Macdonald wrote:
> On 24/11/14 08:32, Aaron Meurer wrote:
>> Did it not say what the exception was?
>
> No :( I was hoping to confirm whether it was a local issue or a general
> 0.7.6-on-windows problem before I tried to dig further.

I got a bit further: this should be for the same fourier command:

````
Traceback (most recent call last):
File "py.py", line 904, in <module>
File "<string>", line 1, in <module>
File "<string>", line 7, in <module>
File "<string>", line 4, in _fcn
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\transforms.py",
line 1364, in fourier
_transform
return FourierTransform(f, x, k).doit(**hints)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\transforms.py",
line 118, in doit
self.function_variable, self.transform_variable, **hints)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\transforms.py",
line 1307, in _comput
e_transform
self.__class__._name, **hints)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\transforms.py",
line 196, in wrapper
res = func(*args, **kwargs)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\transforms.py",
line 1284, in _fourie
r_transform
F = integrate(a*f*exp(b*I*x*k), (x, -oo, oo))
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\utilities\decorator.py",
line 35, in threaded_f
unc
return func(expr, *args, **kwargs)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\integrals.py",
line 1232, in integrat
e
risch=risch, manual=manual)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\integrals.py",
line 467, in doit
ret = try_meijerg(function, xab)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\integrals.py",
line 444, in try_meije
rg
res = meijerint_definite(function, x, a, b)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\meijerint.py",
line 1746, in meijerin
t_definite
res1 = _meijerint_definite_2(f.subs(x, x + c), x)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\meijerint.py",
line 1855, in _meijeri
nt_definite_2
res = _meijerint_definite_3(g, x)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\meijerint.py",
line 1867, in _meijeri
nt_definite_3
res = _meijerint_definite_4(f, x)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\meijerint.py",
line 1932, in _meijeri
nt_definite_4
f1, f2, x, full_pb)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\meijerint.py",
line 898, in _rewrite_
saxena
g2 = pb(g2)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\integrals\meijerint.py",
line 874, in pb
per = g.get_period()
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\functions\special\hyper.py",
line 578, in get_p
eriod
beta = compute(self.bm)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\functions\special\hyper.py",
line 575, in compu
te
if not Mod((b - l[j]).simplify(), 1):
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\core\expr.py",
line 2922, in simplify
return simplify(self, ratio, measure)
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\simplify\simplify.py",
line 3671, in simplify
from sympy.vector import Vector
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\vector\__init__.py",
line 1, in <module>
from sympy.vector.vector import (Vector, VectorAdd, VectorMul,
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\vector\vector.py",
line 6, in <module>
from sympy.vector.basisdependent import BasisDependent, \
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\vector\basisdependent.py",
line 9, in <module>
class BasisDependent(Expr):
File
"N:\win32\octave-3.8.2\share\octave\packages\octsympy-0.1.1\bin\sympy\vector\basisdependent.py",
line 70, in BasisDep
endent
evalf.__doc__ += Expr.evalf.__doc__
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'NoneType'
````
0xC5326EE5.asc
signature.asc

Abhas Bhattacharya

unread,
Nov 24, 2014, 5:43:12 AM11/24/14
to sy...@googlegroups.com
Tested on Windows 8 with Python2.7. Works fine.

Colin Macdonald

unread,
Nov 24, 2014, 6:47:51 AM11/24/14
to sy...@googlegroups.com
On 24/11/14 10:43, Abhas Bhattacharya wrote:
> Tested on Windows 8 with Python2.7. Works fine.

Thanks! And what is your Python distribution? (i.e., I assume its not
py.exe from http://www.orbitals.com/programs/pyexe.html)

thanks,
Colin

0xC5326EE5.asc
signature.asc

Abhas Bhattacharya

unread,
Nov 24, 2014, 9:29:56 AM11/24/14
to sy...@googlegroups.com
No, it is the common python installation from python.org.
Btw, why do you prefer py? I remember encountering it while using wxpython. Is it a similar scenario for you?

Colin Macdonald

unread,
Nov 24, 2014, 11:15:00 AM11/24/14
to sy...@googlegroups.com
On 24/11/14 14:29, Abhas Bhattacharya wrote:
> No, it is the common python installation from python.org.
> Btw, why do you prefer py? I remember encountering it while using wxpython.
> Is it a similar scenario for you?

I have a remote Windows login (RDP) to a server. I don't have
permission to install software.

Because py.exe worked (at least for 0.7.5), I decided it would be an
easy way to distribute SymPy and Python with no dependencies. And that
seems to be failing now with 0.7.6.

Colin
0xC5326EE5.asc
signature.asc

Abhas Bhattacharya

unread,
Nov 24, 2014, 12:53:02 PM11/24/14
to sy...@googlegroups.com
You might like http://portablepython.com/wiki/PortablePython2.7.6.1/ (Portable Python), but it has a huge size.
Can you provide the link for py.exe? Cant seem to find it.

Colin Macdonald

unread,
Nov 24, 2014, 12:53:58 PM11/24/14
to sy...@googlegroups.com
On 24/11/14 17:53, Abhas Bhattacharya wrote:
> You might like http://portablepython.com/wiki/PortablePython2.7.6.1/
> (Portable Python), but it has a huge size.
> Can you provide the link for py.exe? Cant seem to find it.

http://www.orbitals.com/programs/pyexe.html

0xC5326EE5.asc
signature.asc

Abhas Bhattacharya

unread,
Nov 24, 2014, 1:04:17 PM11/24/14
to sy...@googlegroups.com
Ok. But import sympy doesnt seem to work there.

Abhas Bhattacharya

unread,
Nov 24, 2014, 1:05:14 PM11/24/14
to sy...@googlegroups.com
How to import such external libraries there?

Abhas Bhattacharya

unread,
Nov 24, 2014, 1:12:26 PM11/24/14
to sy...@googlegroups.com
Anyway, figured that out.
And everything seems to work fine. This is what I get.
Attached image.
sym.png

Aaron Meurer

unread,
Nov 24, 2014, 2:46:51 PM11/24/14
to sy...@googlegroups.com
Hmm, I think py2exe changes some behavior of the interpreter. I've
seen some issues on StackOverflow in the past where it couldn't
compile SymPy, for instance. In this case, it looks like it sets
__doc__ on a method to be None instead of the docstring. This really
looks like a but in py.exe or py2exe.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/54731ADF.10405%40maths.ox.ac.uk.

Colin Macdonald

unread,
Nov 26, 2014, 5:10:04 PM11/26/14
to sy...@googlegroups.com
On 24/11/14 19:45, Aaron Meurer wrote:
> Hmm, I think py2exe changes some behavior of the interpreter. I've
> seen some issues on StackOverflow in the past where it couldn't
> compile SymPy, for instance. In this case, it looks like it sets
> __doc__ on a method to be None instead of the docstring. This really
> looks like a but in py.exe or py2exe.

Is there anything special about the sympy/ directory from the windows
.exe installer? CRLF endlines? Anything else? I ask b/c I took sympy/
from the source .tar.gz file not the .exe installer.

I'd like to debug a little further, then take up with the py.exe
maintainer, given that it works for Abhas Bhattacharya with py.exe (!)

thanks,
Colin
0xC5326EE5.asc
signature.asc

Colin Macdonald

unread,
Nov 26, 2014, 5:12:05 PM11/26/14
to sy...@googlegroups.com
On 24/11/14 18:12, Abhas Bhattacharya wrote:> Anyway, figured that out.
> And everything seems to work fine. This is what I get.
> Attached image.

Thank you. Very strange! I run exactly that and I get the error.

(If easy enough or if you are intrigued, would you mind zipping up your
"F:\Python27\Lib\site-packages\sympy" directory and sending it to me
personally?)

thanks,
Colin
0xC5326EE5.asc
signature.asc

Colin Macdonald

unread,
Nov 26, 2014, 5:29:37 PM11/26/14
to sy...@googlegroups.com
On 26/11/14 22:11, Colin Macdonald wrote:
> On 24/11/14 18:12, Abhas Bhattacharya wrote:> Anyway, figured that out.
>> And everything seems to work fine. This is what I get.
>> Attached image.
>
> Thank you. Very strange! I run exactly that and I get the error.
>
> (If easy enough or if you are intrigued, would you mind zipping up your
> "F:\Python27\Lib\site-packages\sympy" directory and sending it to me
> personally?)

hmmm, nevermind, the .exe turns out to be basically just a zip file, so
extracted it that way.

It still fails for me using the same py.exe as you.

I will contain the py.exe author and see if he knows.
0xC5326EE5.asc
signature.asc

Aaron S. Meurer

unread,
Nov 26, 2014, 5:32:39 PM11/26/14
to sy...@googlegroups.com
The exe installer is built using the standard setup.py command. bdist_win32 or something like that.

By the way, I forgot that Matthew Brett has a bot that should have build Windows installers for this release. I'll need to check on it and see if they work.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/54764FB8.6060401%40maths.ox.ac.uk.
> For more options, visit https://groups.google.com/d/optout.
> <0xC5326EE5.asc>
Reply all
Reply to author
Forward
0 new messages