I’m a noob using Octave and struggled to install or use the “symbolic” package properly. Questions at the end of this message.
All instances of https:// replaced with h_____ to adhere to hyperlink restrictions for newbies posting; apologies
- MacOS Big Sur v11.2.1
- GNU Octave, v6.1.0 installed using HomeBrew
.> Symbolic pkg v2.9.0
- Python v3.9.1
.> mpmath v1.2.1 installed using pip3
.> sympy v1.7.1 installed using pip3
Dependencies for Symbolic pkg v2.9.0 @ Octave Forge - The 'symbolic' package are:
- octave ≥ 4.2. OK!
Runtime system dependencies
- python, sympy (≥ 1.2) OK!
- mpmath (≥ 1.0) OK!
SymPy supports according to Installation — SymPy 1.7.1 documentation
Only Python 3.5, 3.6, 3.7, and PyPy. (not OK?)
SymPy seems to be working in Python v3.9.1 as shown below.
I tested the sympy package at the Python prompt by doing the following
$ python .>>> from sympy import * .> x = Symbol('x') .>>> limit(sin(x)/x, x, 0) 1 .>>> integrate(1/x, x) log(x)
When I do the following in Octave
>> pkg load symbolic >> syms a b c x Symbolic pkg v2.9.0: Traceback (most recent call last): File "<stdin>", line 28, in <module> AttributeError: '_PrintFunction' object has no attribute '__globals__' 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 AttributeError: module 'sympy' has no attribute 'compatibility' Closing the Python communications link. error: Python exception: AttributeError: '_PrintFunction' object has no attribute '__globals__' occurred in python_header import block. Try "sympref reset" and repeat your command? (consider filing an issue at h_____github.com/cbm755/octsympy/issues) error: called from pycall_sympy__ at line 191 column 5 valid_sym_assumptions at line 38 column 10 assumptions at line 82 column 7 syms at line 97 column 13
sympref reset and repeated
syms a b c x as suggested in the message above.
I did not log the problem at Issues · cbm755/octsympy · GitHub as was not sure what to report exactly.
I used the messages below reporting similar problems to base my questions on.
- Octave 4.2.2 and sympy 1.6 - Stack Overflow
- symbolic not working with sympy 1.6 · Issue #1023 · cbm755/octsympy · GitHub
- Problems with symbolic on Mac · Issue #1041 · cbm755/octsympy · GitHub
QUESTIONS I HAVE:
- Am I doing something wrong; overlooking something or missing something?
- Should I try downgrading my version of SymPy to 1.6 or even 1.5.1?
- Do these versions of SymPy work with Python 3.9 or should I downgrade my version of Python to ver 3.7 as well?
- How should I do these changes in order to make it all work correctly in Octave? It was already an adventure to get this far ;-).
All help is greatly appreciated.
Thanks in advance