Code suddenly not working when it worked the day before despite it being completely unchanged

I have been working on a simulation for a physics class and the code worked perfectly yesterday but today it doesn’t work. I haven’t changed a single thing, I even went back and restored to the version from last night that was worked then. I’m completely lost as to why this would happen. I’ve narrowed the issue down to something with importing matplotlib but other than that I’m at a loss. Any help is appreciated.

I can see matplotlib itself not working from missing object files
Maybe try remove and reinstall matplotlib? That probably helps

Some of my students have tried saying this exact situation has happened. What usually turns out to be the case is that they can’t find their previous save.

Of course, thats not what is happening here. What I might suggest is that you check the code and see if there’s anything that does not look right and fixing it up anyways. Regardless of whether it worked yesterday or not, replit will run the code “as is.” So if there’s something wrong with the code, fix the code.

Hello, the error (ImportError: cannot open shared object file: No such file or directory) is very likely related to a small new replit python feature:

In the meantime, have you ever modified the hidden file replit.nix? I do not understand the new feature that well, I need to know more about how it functions.

One workaround, if this is really causing the problem, is to turn off Explorer mode in replit account settings.
Another workaround would be to add pkgs.python310Packages.matplotlib to the deps variable in replit.nix file. (Probably all other deps and the env variable can be deleted). This completely bypasses pip and poetry, the normal python package managers, which use .pythonlibs directory.

You can test if you have this new python dependencies feature by typing this is shell:

pid1 --version

and it would give pid1: 0.0.0-5440be3+nix if you have it. The feature is currently only for Explorer mode, therefore you can turn it off.

Replit has been notified and the feature has been disabled until they fix it.

1 Like