自从我的Mac 文稿文件夹被sudo误初始化后,我的python IDLE就一直打不开.[已解决]
因为IDLE依赖于这个文件夹.
解决方法:
1.打开 IDLE.app/Contents/MacOS/
2.运行IDLE.app/Contents/MacOS/IDLE
运行结果:
Traceback (most recent call last):
File "/Applications/Python 3.9/IDLE.app/Contents/Resources/idlemain.py", line 8, in <module>
os.chdir(os.path.expanduser('/Applications/Python 000'))
FileNotFoundError: [Errno 2] No such file or directory: '/Applications/Python 000'
3.前往/IDLE.app/Contents/Resources/idlemain.py
内容如下:
"""
Bootstrap script for IDLE as an application bundle.
"""
import sys, os
# Change the current directory the user's home directory, that way we'll get
# a more useful default location in the open/save dialogs.
os.chdir(os.path.expanduser('/A