
Hi all,
I recently started to use python with jupyter notebook.
As I am not familiar with Python at all, I made a terrible mistake last night.
As you can see from the screenshot, I deleted a map - my desktop - as I wanted to have a better overview, but apparently this software/ program has the power to delete all my files on my desktop ?? And it is not in the bin neither, it was deleted directly !
Naïve as I am I never made a backup from my files on my desktop and consequently everything is gone..
I tried to recover my files through EaseUS Data Recovery wizard and Stellar Phoenix windows data recovery and it manages to find the files, though all of them (jpeg, videos, excel, ppt, ..) are 0kb hence I cannot recover them.
I am really upset and have no clue how I can recover everything..
I would really appreciate help !!

Thanks,
A
They are probably in your .Trash folder. Depending on your OS, you'll find that in different locations. I believe that jupyter notebook uses this library: https://pypi.org/project/Send2Trash/ so you can check the details to see where it went.
Hi,
Thank you very much for your answer !! Glad to hear I might recover my files...
However as I said, I am an absolute beginner in Python, hence I am not sure what to do.
This "pip install Send2Trash" I need to write it in the black screen (the prompt) or in my text file ?
I guess if you can guide me or take a quick screenshot, it might help me better to understand
My apologies for this probably dumb answer.
No problem... we all start somewhere!
You don't need to install Send2Trash as it is already on your system. If you knew Python, you could look at the details of where it put your files.
What operating system on you using? If you are on Linux, your files might be here: ~/.local/share/Trash/files/
If you are on Mac or Linux, you could do this at the terminal command line:
find ~/ | grep Trash
Hi,
thank for your understanding.
I work on a windows 10 operating system, what do you recommend ?
I haven't used Windows since about 1995. But googling some key words gives:
Here's how to get the Recycle Bin on your desktop in Windows 10:
Thank you for your reply.
I'm afraid that this won't help, since my files were deleted through jupyter and in fact never ended up in my recycle bin, but were erased directly from my pc and consequently it seems that it cannot be recovered by any data recovery software.
But as you mentioned earlier there is a recycle bin with jupyter that I can access ?
Thanks in advance
I'm pretty sure that Jupyter will not delete the files, but moves them to the system Recycle bin if possible. Deleting entire directories was not added until after the "send to trash" feature was added.
Apparently they do delete files or folders directly.. The space on my disk went from 50gb to 100gb directly after , hence my request to recover this.. I cannot imagine I am the first one that has encountered this ..
If you assume that my deleted files went to my local trash bin on my computer, I can assure you it did not.
Does anyone has any ideas ?
What version of Jupyter notebook do you have? In a command prompt, run jupyter notebook --version to check.
What does Python give you for import sys; sys.platform ? It should be "win32" for Windows, but it's worth double checking, because if it doesn't recognise the platform, it might have tried to use the Linux trash system.
But if the free disk space has increased as you say, it has probably somehow bypassed any kind of trash. I'd like to figure out how that happened, but for your files probably the only chance is to try some other 'undelete' tools. I don't know any to recommend, though.
@hsoft do you know of any conditions where send2trash might really delete a directory instead of putting it in trash?
Hi takluyver,
Thank you for taking the time to help me,
Apparently I have version 5.4.0
And i get win32 as well.
I already used advances recovery tools and although they found them, I cannot recover any..
It is almost impossible that everything was deleted directly from my pc..
Any ideas? Or someone else has similar experience ?
On windows? It's been a long long while since I touched anything related to windows. I seem to remember that in some cases, Windows would offer to delete a file directly when it couldn't send it to trash (files over a network share) but IIRC, send2trash would just fail to process this kind of file.
Hence, no solution whatsoever?
If 50 GB of disk space has become free and recovery tools aren't working, I'm pretty sure that data is gone. The only thing I can suggest is to try a different recovery tool; maybe there are different techniques they can use, and some other tool will be able to recover some of your files.
What I'm still trying to work out is how this could happen.
send2trash seems to be doing a 'delete' file operation and setting the FOF_ALLOWUNDO flag to make that mean 'put it in the recycle bin'. However, the docs for that flag mention that it only allows undoing 'if possible'. Some SO questions suggest that there are situations where files can still be really deleted:
The second question and this linked codeguru thread mentions a few possible ways around this, none of them great:
FOF_WANTNUKEWARNING will display an interactive Windows 'are you sure' dialog box. But if you've just clicked yes to one are-you-sure warning, you'll probably grumpily click yes to another one. And if you access Jupyter remotely, the Windows dialog won't show up remotely, and it will probably just hang.I'm really surprised that Windows doesn't appear to have any convenient API to trash a file but error out if it's not possible to move it to the recycle bin. :confused:
Thanks for your reply,
However your explanation is too technical for me to understand.
As you can see on the screenshot I have made when I started this discussion, all I did is confirm to delete my folder -being desktop- to delete without realizing that this program would have the power to delete all of these without apparently having the opportunity to get it back..
There must be a way to recover, I cannot imagine that jupyter can be a super advanced program to delete files, whithout a change of recovering it. Or is this an additional feature? ;)
If so, I will use jupyter as anew method when I want to delete files permanently!
Joking aside, I need my folders back!
Sorry. The technical details are me trying to figure out what happened. The summary is:
Jupyter is a programming tool, and the default assumption for programmers is that if you tell the computer to do something, it does it. Always check what's in a folder before deleting it!
Thank you for your elaborated answer.
If anyone can recommend a program that might help to recover files after a programming tool has deleted it, let me know
Maybe there is a way I can recover a parts (few gigabytes) of what I lost?
What is new @Atero?
Today, the same thing happened with me!!
I had committed the same mistake but all the files ended up in my recycle bin. My problem was solved after I restored everything from the recyclebin. I am using Windows 10 32-bit.
The same thing happened with me today, I deleted my desktop folder.
Hi all,
please let me know if data can recover from python. same happened with me
Hi there,
Can anyone help me. I accidentally delete everything from my computer using Jupyter. There are so many important folders that I have deleted. My whole PhD thesis. My all certification work.
Can anyone please please help me. The space in my hard drive is increased now. I have also checked recycle bin, files and folders are not there. I was trying to open jupyter from Anaconda. It did not open and went to website and then I did that stupidity. Please any one can help this regard
I'm going to summarise the available information about this, to the best of my knowledge.
jupyter notebook --version.That's about all the information I can give anyone.
One more thing:
I may have accidentally deleted some files as well, however I am on Mac and am using Jupyter Notebook version 6.0.3. Where would I look or are they still permanently gone?
Most helpful comment
No problem... we all start somewhere!
You don't need to install Send2Trash as it is already on your system. If you knew Python, you could look at the details of where it put your files.
What operating system on you using? If you are on Linux, your files might be here: ~/.local/share/Trash/files/
If you are on Mac or Linux, you could do this at the terminal command line:
find ~/ | grep Trash