Help with problems with symbolic package

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with problems with symbolic package

dariobc
Hello, I recently installed Octave and I need to use the symbolic
package.
I downloaded it from the sourceforge of Octave, but I've had some
problems
when I started using it. I have installed Python 3.9 and the last
version of
the sympy module.
I load the package with 'pkg load symbolic' and there is no problem (at
least
it is correctly installed), but when I try to do anything... let´s say
define
a real variable like 'syms x real' I get some errors. The first one was
a bit
silly, related to the environment variable for python (it is 'python3'
default
but in my case is 'python'). I changed it so Octave could start running
the
package, but then I get some other errors I can't solve:

<--beginning of code-->

octave:1> pkg load symbolic
octave:2> syms x real
Symbolic pkg v2.9.0:
C:\Users\darma\AppData\Local\Programs\Python\Python39\lib\site-packages\sympy\__init__.py:672:
SymPyDeprecationWarning:

importing sympy.core.compatibility with 'from sympy import *' has been
deprecated since SymPy 1.6. Use import sympy.core.compatibility
instead. See https://github.com/sympy/sympy/issues/18245 for more
info.

   self.Warn(
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "<stdin>", line 12, in octoutput_drv
   File "<stdin>", line 54, in octoutput
   File "<stdin>", line 55, in octoutput
   File
"C:\Users\darma\AppData\Local\Programs\Python\Python39\lib\site-packages\sympy\__init__.py",
line 677, in __getattr__
     return getattr(self.mod, name)
AttributeError: module 'sympy.core.compatibility' has no attribute
'integer_types'
Waiting...............warning: readblock: timeout of 30 exceeded,
breaking out
warning: called from
     readblock at line 101 column 7
     python_ipc_popen2 at line 99 column 16
     python_ipc_driver at line 62 column 15
     pycall_sympy__ at line 163 column 11
     valid_sym_assumptions at line 38 column 10
     assumptions at line 82 column 7
     syms at line 97 column 13
no output so far

error: ipc_popen2: something wrong? timed out starting python
error: called from
     python_ipc_popen2 at line 101 column 7
     python_ipc_driver at line 62 column 15
     pycall_sympy__ at line 163 column 11
     valid_sym_assumptions at line 38 column 10
     assumptions at line 82 column 7
     syms at line 97 column 13

<--end of code-->

I really need it to avoid using MatLab at university. I convinced the
teacher to let me use Octave instead of that horrible proprietary
software, but I am unable to use the free program. Please help soon!
(As you will notify, the computer is using Windows, but I can change
that. However, it is and error related to python and not the OS.)

Happy hacking!
Darío


Reply | Threaded
Open this post in threaded view
|

Re: Help with problems with symbolic package

mmuetzel
Am 07. November 2020 um 14:24 Uhr schrieb [hidden email]:
> Hello, I recently installed Octave and I need to use the symbolic
> package.
> I downloaded it from the sourceforge of Octave, but I've had some
> problems
> when I started using it. I have installed Python 3.9 and the last
> version of
> the sympy module.

I believe the current version of the symbolic package doesn't work correctly with the latest version of sympy.

The next version of Octave for Windows will ship the symbolic package with the necessary dependencies. You could try the release candidate version 6.0.92 that you can download from here:
https://alpha.gnu.org/gnu/octave/?C=M;O=D

After installing it, just load the symbolic package with "pkg load symbolic".

Please, let the list know if that works for you.

HTH,
Markus


Reply | Threaded
Open this post in threaded view
|

Re: Help with problems with symbolic package

mmuetzel
Am 07. November 2020 um 17:56 Uhr schrieb [hidden email]:

> >> Hello, I recently installed Octave and I need to use the symbolic
> >> package.
> >> I downloaded it from the sourceforge of Octave, but I've had some
> >> problems
> >> when I started using it. I have installed Python 3.9 and the last
> >> version of
> >> the sympy module.
> >
> > I believe the current version of the symbolic package doesn't work
> > correctly with the latest version of sympy.
> >
> > The next version of Octave for Windows will ship the symbolic package
> > with the necessary dependencies. You could try the release candidate
> > version 6.0.92 that you can download from here:
> > https://alpha.gnu.org/gnu/octave/?C=M;O=D
> >
> > After installing it, just load the symbolic package with "pkg load
> > symbolic".
>
> It worked but there are still problems with some functions:
>
> <--beggining of code-->
>
> >> pkg load symbolic
> >> syms x real
> Symbolic pkg v2.9.0:
> /usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:892:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if other is 0:
> /usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:986:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if other is 0:
> /usr/lib/python3.8/site-packages/sympy/solvers/diophantine.py:3186:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if feasible is 1:  # it's prime and k == 2
> /usr/lib/python3.8/site-packages/sympy/plotting/plot.py:509:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if self.xscale is 'log':
> /usr/lib/python3.8/site-packages/sympy/plotting/plot.py:529:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if self.xscale is 'log':
> /usr/lib/python3.8/site-packages/sympy/plotting/plot.py:542:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if self.xscale is 'log':
> /usr/lib/python3.8/site-packages/sympy/plotting/plot.py:549:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if self.xscale is 'log':
> /usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:892:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if other is 0:
> /usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:986:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if other is 0:
> /usr/lib/python3.8/site-packages/sympy/solvers/diophantine.py:3186:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if feasible is 1:  # it's prime and k == 2
> /usr/lib/python3.8/site-packages/sympy/plotting/plot.py:509:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if self.xscale is 'log':
> /usr/lib/python3.8/site-packages/sympy/plotting/plot.py:529:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if self.xscale is 'log':
> /usr/lib/python3.8/site-packages/sympy/plotting/plot.py:542:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if self.xscale is 'log':
> /usr/lib/python3.8/site-packages/sympy/plotting/plot.py:549:
> SyntaxWarning: "is" with a literal. Did you mean "=="?
>    if self.xscale is 'log':
> Python communication link active, SymPy v1.4.
> >> f(x)=x^2
> f(x) = (symfun)
>
>     2
>    x
>
> >> fplot(f)
> error: isalnum: not defined for class
> error: called from
>      fplot at line 108 column 3
> >> fplot(f(x))
> error: isalnum: not defined for class
> error: called from
>      fplot at line 108 column 3
>
> <--end of code-->
>
> So, at least I can work with the real variable, but I have to plot
> functions and so... Do you know how to solve this? And, about the
> SyntaxWarning, AFAIK, in Python 'a is b' is like the identity
> comparison... I think all the lines were it showed a warning would
> return falsa, as long as and object just created for the comparison and
> one stored as a variable are obviously not the same. But that might be a
> Python problem. I will check on my own, but please tell me if you know
> how to make the functions like 'fplot(symfun(syms))' work.
>
> However, thanks a million for solving my first problem!
>
> > Please, let the list know if that works for you.
>
> I will, but when it actually works.
>
> Happy hacking!
> Darío

Please, keep the mailing list in CC. Other people are probably more able to help you.

Markus



Reply | Threaded
Open this post in threaded view
|

Re: Help with problems with symbolic package

dariobc
In reply to this post by mmuetzel
I didn't CC my answer to Markus. Here you have it now:

[I don't repeat all the first message as long as it is currently solved
(by installing the last alpha)]

-------- Original Message --------
Date: 2020-11-07 16:56
 From: [hidden email]
To: Markus Mützel <[hidden email]>

>> Hello, I recently installed Octave and I need to use the symbolic
>> package.
>> I downloaded it from the sourceforge of Octave, but I've had some
>> problems
>> when I started using it. I have installed Python 3.9 and the last
>> version of
>> the sympy module.
>
> I believe the current version of the symbolic package doesn't work
> correctly with the latest version of sympy.
>
> The next version of Octave for Windows will ship the symbolic package
> with the necessary dependencies. You could try the release candidate
> version 6.0.92 that you can download from here:
> https://alpha.gnu.org/gnu/octave/?C=M;O=D
>
> After installing it, just load the symbolic package with "pkg load
> symbolic".

It worked but there are still problems with some functions:

<--beggining of code-->

>> pkg load symbolic
>> syms x real
Symbolic pkg v2.9.0:
/usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:892:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if other is 0:
/usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:986:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if other is 0:
/usr/lib/python3.8/site-packages/sympy/solvers/diophantine.py:3186:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if feasible is 1:  # it's prime and k == 2
/usr/lib/python3.8/site-packages/sympy/plotting/plot.py:509:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if self.xscale is 'log':
/usr/lib/python3.8/site-packages/sympy/plotting/plot.py:529:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if self.xscale is 'log':
/usr/lib/python3.8/site-packages/sympy/plotting/plot.py:542:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if self.xscale is 'log':
/usr/lib/python3.8/site-packages/sympy/plotting/plot.py:549:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if self.xscale is 'log':
/usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:892:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if other is 0:
/usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:986:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if other is 0:
/usr/lib/python3.8/site-packages/sympy/solvers/diophantine.py:3186:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if feasible is 1:  # it's prime and k == 2
/usr/lib/python3.8/site-packages/sympy/plotting/plot.py:509:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if self.xscale is 'log':
/usr/lib/python3.8/site-packages/sympy/plotting/plot.py:529:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if self.xscale is 'log':
/usr/lib/python3.8/site-packages/sympy/plotting/plot.py:542:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if self.xscale is 'log':
/usr/lib/python3.8/site-packages/sympy/plotting/plot.py:549:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if self.xscale is 'log':
Python communication link active, SymPy v1.4.
>> f(x)=x^2
f(x) = (symfun)

    2
   x

>> fplot(f)
error: isalnum: not defined for class
error: called from
     fplot at line 108 column 3
>> fplot(f(x))
error: isalnum: not defined for class
error: called from
     fplot at line 108 column 3

<--end of code-->

So, at least I can work with the real variable, but I have to plot
functions and so... Do you know how to solve this? And, about the
SyntaxWarning, AFAIK, in Python 'a is b' is like the identity
comparison... I think all the lines were it showed a warning would
return false, as long as and object just created for the comparison and
one stored as a variable are obviously not the same. But that might be a
Python problem. I will check on my own, but please tell me if you know
how to make the functions like 'fplot(symfun(syms))' work.

However, thanks a million for solving my first problem!

Happy hacking!
Darío


Reply | Threaded
Open this post in threaded view
|

Re: Help with problems with symbolic package

dariobc
> So, at least I can work with the real variable, but I have to plot
> functions and so... Do you know how to solve this? And, about the
> SyntaxWarning, AFAIK, in Python 'a is b' is like the identity
> comparison... I think all the lines were it showed a warning would
> return false, as long as and object just created for the comparison
> and one stored as a variable are obviously not the same. But that
> might be a Python problem. I will check on my own, but please tell me
> if you know how to make the functions like 'fplot(symfun(syms))' work.
>
> However, thanks a million for solving my first problem!

Well, I've corrected those errors in 'plot.py', and it seems they
weren't crucial, because it continues having the same problem. I've
checked for some syntax errors in the function, varying throw the
different options that MatLab would give but that's neither the problem
(it would be weird if so... It makes no sense that a syntax error for
missing arguments gives that kind of exception 'isalnum'):

<--beggining of code-->

octave:1> pkg load symbolic
octave:2> syms x real
Symbolic pkg v2.9.0:
/usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:892:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if other is 0:
/usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:986:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if other is 0:
/usr/lib/python3.8/site-packages/sympy/solvers/diophantine.py:3186:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if feasible is 1:  # it's prime and k == 2
/usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:892:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if other is 0:
/usr/lib/python3.8/site-packages/mpmath/ctx_mp_python.py:986:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if other is 0:
/usr/lib/python3.8/site-packages/sympy/solvers/diophantine.py:3186:
SyntaxWarning: "is" with a literal. Did you mean "=="?
   if feasible is 1:  # it's prime and k == 2
Python communication link active, SymPy v1.4.
octave:3> f(x)=x^2
f(x) = (symfun)

    2
   x

octave:4> fplot(f)
error: isalnum: not defined for class
error: called from
     fplot at line 108 column 3
octave:5> fplot(f(x))
error: isalnum: not defined for class
error: called from
     fplot at line 108 column 3
octave:6> fplot(f(x),x)
error: isalnum: not defined for class
error: called from
     fplot at line 108 column 3

<--end of code-->

I've realize some mail clients might consider the '>>' from the Octave
GUI line as an answer or cite, so I've did it through the CLI this time.
Please, any idea is welcome!

Happy hacking!
Darío


Reply | Threaded
Open this post in threaded view
|

Re: Help with problems with symbolic package

siko1056
On 11/8/20 2:45 AM, [hidden email] wrote:
>
> [...] Well, I've corrected those errors in 'plot.py' [...]
>
> Happy hacking!
> Darío
>
>

Dear Darío,

On this mailing-list your contributions are probably lost and many users
are facing this problem.  Please report your findings to the symbolic
package maintainers [1].

Thank you,
Kai

[1] https://github.com/cbm755/octsympy/issues/1023


Reply | Threaded
Open this post in threaded view
|

Re: Help with problems with symbolic package

José Abílio Matos