Jupyter notebook can't load a local f2py module

That’s progress. And so that was the original issue and why Python was giving you a different result than running in a Jupyter Notebook .ipynb file. Jupyter handles environments independent of the system Python, and so switching between the two different contexts isn’t just plug-and-play always.

To answer that we’d have to do more investigating than you’ve provided the ability to pursue. I would suggest tentatively maybe I already answered the question above. The system on your machine and system python are different things than what Jupyter is involved with. You need to provide that path to your running kernel. I think though you have other issues so following up on that may not be your priority right now.

This would seem like a better fit for a python forum than here. However, you did say all this code ran just fine with Python, right? That would argue it belongs here. But maybe you just meant the import worked?

I will say though that as posted not many could provide you with much more guidance, unless that is a standard function in fortran that those in the know would inherently be familiar with. You have not provided much in the sense of code. (Personally, I have a feeling if you reverse engineered what arguments worked in calls to centered_difference.centered_difference(), you may be able to troubleshoot this yourself.)
So in line with you not providing much in the terms of code that those trying to help you could go on… I’d urge you to please read Getting good answers to your questions. It will help you in other forums as well if you realize this forum isn’t pertinent.

1 Like