Home > Net >  How to restore a changed native python file?
How to restore a changed native python file?

Time:05-09

I have accidentally overwritten a native python file (Python\Python310\Lib\wave.py). I cant restore it through Windows.

Is there a clever way to restore it? I was thinking to reinstall Python, but Im afraid that I might need to reinstall all my packages, which would be a pain. Are there other options?

CodePudding user response:

Fixed by finding the native Python source code through Repair Python

And to ease your pain from reinstalling the modules, you can use the below to save all modules names with version.

pip freeze >a.txt

Then after reinstalling use

pip install -r a.txt

This would install all the module in the text. For more detail you can use pip install -help

  • Related