Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

Hi! I ask you for help to deal with a problem with the linsolve command.

The expression I write is simplified: the presence of the input_form() is linked to the fact that linsolve is iterated within a for loop and therefore I have to adapt the arguments of the command linsolve to the presence of the cyclic variable, which for this example I have removed.

The following command works in the cadabra cloud version

import cdb.sympy.solvers as solv

I := 0 = a + b + 13;
II := 0 = b + 2*a - 34;
sols=solv.linsolve(Ex(str(I.input_form())+r','+str(II.input_form())),Ex(r'a'+r',b'));
sols[0][0];
sols[0][1];

but never works using the github one, giving the error:

AttributeError: module 'sympy' has no attribute 'linsolve'

At:
/home/ubuntu-mate/.config/cadabrapackages/cdb/sympy/solvers.py(35):
linsolve
/home/ubuntu-mate/.config/cadabra
packages/cdb/sympy/solvers.py(49):
(222):
callwithframesremoved (665): execmodule (673): _loadunlocked (958): findandloadunlocked (969): findand_load (2):

Thanks,
Mattia

asked in General questions by (410 points)

1 Answer

+1 vote

Your sympy does not have linsolve, better upgrade it to something more recent.

answered by (52.7k points)

Dear Kasper, thanks for your reply.
The commend sympy.__version__ gives 0.7 in my github Cadabra version.
I updated my sympy version with the shell command $ pip install --upgrade sympy and the command pip show sympy gives now 1.5 (the sympy version on the cloud is 1.4). Unfortunately, when then I run sympy.__version__ again, i continue to have the o.7 version... how can I solve?
Thanks, Mattia

Welcome to the world of broken python package management, which everyone seems to think is great but actually could not possibly be any worse.

You probably have some system package with sympy installed as well; given your error message, it looks like you might get this solved with sudo apt uninstall python3-sympy.

...