And just to verify, what version of SymPy are you using?

Aaron Meurer

On Mon, Jun 24, 2013 at 4:34 PM, peibol <pabe...@gmail.com> wrote:
> Sure, here is the traceback, and I attach the controller that generates it
> (line 66 is just   from sympy import *:
>
> 2013-06-24 23:28:15.534 /myeducenter/worksheets/fractions1topdf 500 3419ms
> 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like
> Gecko) Chrome/27.0.1453.116 Safari/537.36
>
> 95.121.196.14 - - [24/Jun/2013:14:28:15 -0700] "GET
> /myeducenter/worksheets/fractions1topdf HTTP/1.1" 500 384 - "Mozilla/5.0
> (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
> Chrome/27.0.1453.116 Safari/537.36" "myeduapps.appspot.com" ms=3419
> cpu_ms=2014 cpm_usd=0.000043 loading_request=1 app_engine_release=1.8.1
> instance=00c61b117cc9d943618bc9990d62cb26442171
>
> E2013-06-24 23:28:15.532
>
> In FILE:
> /base/data/home/apps/s~myeduapps/2.368322769822934897/applications/myeducenter/controllers/worksheets.py
>
> Traceback (most recent call last):
>   File
> "/base/data/home/apps/s~myeduapps/2.368322769822934897/gluon/restricted.py",
> line 212, in restricted
>     exec ccode in environment
>   File
> "/base/data/home/apps/s~myeduapps/2.368322769822934897/applications/myeducenter/controllers/worksheets.py",
> line 250, in <module>
>   File
> "/base/data/home/apps/s~myeduapps/2.368322769822934897/gluon/globals.py",
> line 194, in <lambda>
>     self._caller = lambda f: f()
>   File
> "/base/data/home/apps/s~myeduapps/2.368322769822934897/applications/myeducenter/controllers/worksheets.py",
> line 66, in fractions1topdf
>     from sympy import *
>   File
> "/base/data/home/apps/s~myeduapps/2.368322769822934897/gluon/custom_import.py",
> line 87, in custom_importer
>     return base_importer(pname, globals, locals, fromlist, level)
>   File "applications/myeducenter/modules/sympy/__init__.py", line 49, in
> <module>
>     from sympy.core import *
>   File
> "/base/data/home/apps/s~myeduapps/2.368322769822934897/gluon/custom_import.py",
> line 87, in custom_importer
>     return base_importer(pname, globals, locals, fromlist, level)
>   File "applications/myeducenter/modules/sympy/core/__init__.py", line 8, in
> <module>
>     from expr import Expr, AtomicExpr
>   File
> "/base/data/home/apps/s~myeduapps/2.368322769822934897/gluon/custom_import.py",
> line 87, in custom_importer
>     return base_importer(pname, globals, locals, fromlist, level)
> ImportError: No module named expr
>
> E2013-06-24 23:28:15.533
>
> /base/data/home/apps/s~myeduapps/2.368322769822934897/applications/myeducenter/controllers/worksheets.py:51:
> SyntaxWarning: import * only allowed at module level
>
> E2013-06-24 23:28:15.533
>
>   def fractions1topdf():
>
> E2013-06-24 23:28:15.533
>
> /base/data/home/apps/s~myeduapps/2.368322769822934897/applications/myeducenter/controllers/worksheets.py:160:
> SyntaxWarning: import * only allowed at module level
>
>
> Cheers
> Pablo
>
> El lunes, 24 de junio de 2013 23:01:14 UTC+2, Aaron Meurer escribió:
>>
>> That's because locally, it just uses your Python, without sandboxing
>> it. It doesn't remove the modules that aren't there in the App Engine.
>>
>> I'm not sure why it works in SymPy Live. You can see if there is
>> something in the source (https://github.com/sympy/sympy-live/).
>>
>> The reason I asked about Python 2.7 is that (in master at least), only
>> the Python 2.5 parser users the parser module.
>>
>> Can you post a traceback that you get from the app engine logs (on the
>> dashboard)?
>>
>> Aaron Meurer
>>
>> On Mon, Jun 24, 2013 at 3:28 PM, peibol <pab...@gmail.com> wrote:
>> > Yes
>> >
>> > More details... my app is web2py based and I'm importing sympy as a
>> > module.
>> > The weird thing is that it works in local. I attach my app.yaml.
>> >
>> > Thanks for the reply.
>> >
>> >
>> > El lunes, 24 de junio de 2013 22:23:31 UTC+2, Aaron Meurer escribió:
>> >>
>> >> Are you using Python 2.7 in the App Engine?
>> >>
>> >> Aaron Meurer
>> >>
>> >> On Mon, Jun 24, 2013 at 2:03 PM, peibol <pab...@gmail.com> wrote:
>> >> > Hi there, some update in my progress. I've managed to run the
>> >> > sympy-live
>> >> > in
>> >> > my appengine, so it's clear that not only sympify work in GAE, but
>> >> > the
>> >> > full
>> >> > sympy.
>> >> >
>> >> > But I don't know how to made the imports in order to make sympy work
>> >> > in
>> >> > my
>> >> > app, which in local works fine. Are there any dependences that I'm
>> >> > missing?
>> >> >
>> >> > Thanks!
>> >> >
>> >> >
>> >> > El lunes, 24 de junio de 2013 10:07:49 UTC+2, peibol escribió:
>> >> >>
>> >> >> Hi all
>> >> >> When running in GAE, i get the error "Cannot import module simpify",
>> >> >> while
>> >> >> in local it runs great. Is any other way to proceed with sympy
>> >> >> without
>> >> >> making use of simpify? I've read it's a parser problem here, but I'm
>> >> >> missing
>> >> >> something beacuse for example the sympy live runs on GAE.
>> >> >>
>> >> >> More details about what I need to do. I want to make math
>> >> >> worksheets,
>> >> >> so I
>> >> >> need to deal with algebraic expressions and then susbtitute
>> >> >> variables
>> >> >> by
>> >> >> concrete values, both to calculate the result and to print the latex
>> >> >> expression. Here is an example to print 1/2+2/4 from the expression
>> >> >> a/b+c/d
>> >> >> and calculating the result (3/4)
>> >> >>
>> >> >>
>> >> >>  a,b,c,d = symbols('a b c d')
>> >> >>  fvars = [a,b,c,d]
>> >> >>  values = [1,4,2,4]
>> >> >>  exp=sympify('a/b + c/d')
>> >> >>  res=nsimplify(exp.evalf(subs = dict(zip(fvars,values))))  #this is
>> >> >> the
>> >> >> result: 3/4
>> >> >>  a = sympify(1)
>> >> >>  b = sympify(4)
>> >> >>  c = sympify(2)
>> >> >>  d = sympify(4)
>> >> >>
>> >> >>  exp=exp.subs([(var, Symbol("%s" % i)) for var, i in zip(fvars,
>> >> >> values)])
>> >> >>  straux=urllib.quote(printing.latex(exp))
>> >> >>
>> >> >>
>> >> >>
>> >> >> strchart='http://chart.apis.google.com/chart?cht=tx&chs=140x50&chf=bg,s,FFFFFF00&chl='
>> >> >> + straux
>> >> >>
>> >> > --
>> >> > 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.
>> >> > For more options, visit https://groups.google.com/groups/opt_out.
>> >> >
>> >> >
>> >
>> > --
>> > 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.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to