All of a sudden: "ModuleNotFoundError: No module named 'cantera'"

289 views
Skip to first unread message

Anna Sophia Tombazzi

unread,
Nov 16, 2023, 3:31:00 PM11/16/23
to Cantera Users' Group
Hey Guys, I'm fairly new at coding - I create some code a few months ago through spyder and was able to use cantera, etc. Now when I pull up the same code file (I did change the name) and try to run it, I get the error "ModuleNotFoundError: No module named 'cantera'"

What happened? It worked fine before. Thanks! 

ROHIT MISHRA

unread,
Nov 16, 2023, 9:54:01 PM11/16/23
to canter...@googlegroups.com
You need to source cantera. If you have a terminal interface try: pip install cantera.

On Thu, Nov 16, 2023 at 2:30 PM Anna Sophia Tombazzi <anna.t...@gmail.com> wrote:
Hey Guys, I'm fairly new at coding - I create some code a few months ago through spyder and was able to use cantera, etc. Now when I pull up the same code file (I did change the name) and try to run it, I get the error "ModuleNotFoundError: No module named 'cantera'"

What happened? It worked fine before. Thanks! 

--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cantera-users/867412f0-3f1a-467f-9dff-f203ca5253e7n%40googlegroups.com.

Anna Sophia Tombazzi

unread,
Nov 16, 2023, 9:54:18 PM11/16/23
to Cantera Users' Group
I found the error, sharing it here in case helpful.

I had opened spyder separately (from windows application), and it wasn't loaded in the right conda environment which had cantera. To fix this, I worked through anaconda command prompt to:
Create a environment with cantera
Added spyder to that environment
*** USED conda command prompt to open spyder from that environment - no clicking through windows application.

 That solved it. Thanks! 
Reply all
Reply to author
Forward
0 new messages