First time here? Check out the FAQ!

Ask Your Question
1

How to interact with FriCAS when installed Sage via conda?

asked 0 years ago

IvanaGyro gravatar image

updated 0 years ago

When I execute this line

print(fricas('3 * 5'))

, I got error:

Traceback (most recent call last):
  File "~/miniforge3/envs/sage/lib/python3.12/site-packages/sage/interfaces/expect.py", line 1518, in __init__
    self._name = parent._create(value, name=name)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/miniforge3/envs/sage/lib/python3.12/site-packages/sage/interfaces/interface.py", line 520, in _create
    self.set(name, value)
  File "~/miniforge3/envs/sage/lib/python3.12/site-packages/sage/interfaces/fricas.py", line 681, in set
    self._check_errors(value, output)
  File "~/miniforge3/envs/sage/lib/python3.12/site-packages/sage/interfaces/fricas.py", line 574, in _check_errors
    raise RuntimeError("An error occurred when FriCAS evaluated '%s':\n%s" % (line, output))
RuntimeError: An error occurred when FriCAS evaluated '3 * 5':
  Function declaration sageprint : InputForm -> String has been added to 
      workspace.


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "~/tmp/int.sage.py", line 8, in <module>
    print(fricas('3 * 5'))
          ^^^^^^^^^^^^^^^
  File "sage/misc/lazy_import.pyx", line 406, in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:6293)
  File "~/miniforge3/envs/sage/lib/python3.12/site-packages/sage/interfaces/interface.py", line 299, in __call__
    return cls(self, x, name=name)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "~/miniforge3/envs/sage/lib/python3.12/site-packages/sage/interfaces/expect.py", line 1523, in __init__
    raise TypeError(*x.args)
TypeError: An error occurred when FriCAS evaluated '3 * 5':
  Function declaration sageprint : InputForm -> String has been added to 
      workspace.

There is a qustion, Problems reproducing code on SageMath on a Jupyter NB with dependence on FriCAS, asking about the same erro. The comment under that question suggested install fricas with --enable-fricas flag while installing SageMath from source. However, it seems that --enable-fricas cannot be used when installing SageMath from conda.

How to use the FriCAS interface when installed SageMath via conda? How to know which version is requested by the assigned version of SageMath (i.e. version 10.5)?

versions of my packages installed: - SageMath: 10.5 - FriCAS: 1.3.10 - Python: 3.12.9

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 0 years ago

IvanaGyro gravatar image

updated 0 years ago

After removing FriCAS 1.3.10 (via apt) and re-installing FriCAS 1.3.11 from the tarball, I can use the FriCAS interface and get the correct result.

Preview: (hide)
link

Comments

For the benefit of future ask.sagemath.org (per-)users, a detailed record of what you did might be very useful to anybody in a similar situation.

Furthermore, a (generalization of) this note might be a valuable addition to the documentation. Consider opening an issue against the Installation guide and submitting a PR.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 0 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 0 years ago

Seen: 70 times

Last updated: Mar 11