求助:Python IDLE出现Errno 13权限拒绝错误,无法更新最近文件列表
Hey there, I’ve seen this exact issue pop up with Windows users running IDLE before—let’s get that recent file list working again. The root problem is that your user account doesn’t have write access to the .idlerc folder or the recent-file.lst file inside it. Here are a few straightforward fixes to try:
1. Fix Folder/File Permissions Manually
This is the most reliable solution:
- Open File Explorer and paste
C:\Users\Eigenaar\.idlercinto the address bar. If you don’t see the folder, enable Hidden items under the View tab (it’s in the Show/hide section). - Right-click the
.idlercfolder, select Properties, then switch to the Security tab. - Click Edit to modify permissions, then click Add. Type your username (
Eigenaar) into the box, hit Check Names to confirm, and click OK. - Select your username in the list, check the box for Full Control under the Allow column, then click Apply and OK.
- If the
recent-file.lstfile already exists in the folder, repeat the same permission steps for this file specifically. Or, just delete it—IDLE will automatically create a new one when it needs to.
2. Launch IDLE as Administrator Once
Sometimes a one-time admin launch can kickstart the file creation:
- Find the IDLE shortcut (usually in your Start Menu under Python) or locate the
idle.exefile in your Python installation folder. - Right-click it and select Run as administrator.
- Open any Python file in IDLE, then close the program. This should let IDLE create/update the
recent-file.lstfile with elevated permissions. Next time you launch IDLE normally, it should have the access it needs.
3. Manually Create the Recent File List File
If the above steps don’t work, try making the file yourself:
- Open Notepad, create a blank document, and go to File > Save As.
- Navigate to
C:\Users\Eigenaar\.idlerc, set the file name torecent-file.lst, and change the "Save as type" dropdown to All Files (so it doesn’t save as.txt). - Save the file, then follow the permission steps from Fix 1 to ensure your user account has full control over it.
A quick note: If you have third-party antivirus software running, it might be blocking IDLE from writing to this folder. You can temporarily disable it to test, but the permission fixes above should handle most cases.
Let me know if any of these get your recent file list working again!
内容的提问来源于stack exchange,提问作者Somethingyoudontknow

