Mage.ai is a great tool for data nerds, but it’s not completely done when it comes to user experience just yet. We might encounter some errors that are inherently of a primitive nature, making them sometimes challenging to identify. One of these errors is Error [Errno 2] No such file or directory, and today, I inadvertently ran into this error.
Error [Errno 2] No such file or directory – unable to locate the file
In Mage.ai, it’s important to delete files only through the application’s tools (buttons). If we delete a file “forcefully,” there is a risk that there might be references to that file in yaml files and similar places. However, we can also encounter this error due to our own oversight. Let me try to replicate this error here.
This also applies to the error: The system cannot find the file specified.
Let’s take a file called “kind_sky.py” (data_loader) as an example. I often open this file in the right section of the application window. I have a habit of browsing files directly in the application instead of using tools like Visual Studio and the like. So, I sometimes accumulate tabs there and forget that this file is open.
If I delete the file, an error occurs – which is my own mistake. However, the application could potentially automatically rectify this situation. Now, this message keeps appearing every time I refresh the browser until I notice the error.
I searched everywhere, in files and logs, and then I realized that the solution is much simpler. Perhaps this will help someone. If you have any other problems, don’t hesitate to ask the Mage.ai community on Slack.