First time here? Check out the FAQ!

Ask Your Question
1

SageMath Version 9.5: codegen function does not exist in Jupyter notebooks

asked 2 years ago

St1255 gravatar image

Hello,

I get the following error when I try the example given by benjaminfjones at ask.sagemath.org_question_7922_export-to-c-code. (Replace _ with / to get the link)

NameError: name 'codegen' is not defined.

I am using the jupyter notebooks version of SageMath. The version of SageMath is 9.5.

Here's what the command window shows: SageMath version 9.5, Release Date: 2022-01-30 Using Python 3.10.6. Type "Help()" for help.

The OS is Linux Mint 21 Cinnamon Version 5.4.12. Linux Kernel Version 5.19.0-051900-generic.

Stephen

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 2 years ago

St1255 gravatar image

The post named "sympy codegen with indices" in this forum pointed me to the solution.

I just need to include the following: from sympy.utilities.codegen import codegen

Preview: (hide)
link

Comments

You should accept your own answer to mark it as solved for the benefit of future ask.sagemath.org (per-)users...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2 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: 2 years ago

Seen: 206 times

Last updated: Dec 21 '22

Related questions