PyCharm修改系统缓存路径,防止C盘爆满问题及解决
作者:superstrer
文章介绍了如何更新IDEA和PyCharm编辑器,并修改缓存路径配置以防止C盘空间不足,同时,文章还指导如何迁移旧数据以保持配置一致
最近把电脑上以前旧版本的IDEA、PyCharm等编辑器都更新了以下,以前的版本较久了,更新后防止软件用着用着C盘满了,修改了一些缓存路径的配置,记录一下防止自己以后再安装时遗忘。
修改配置文件idea.properties
在pycharm安装路径的bin目录下,打开idea.properties文件:

修改如下配置项:

#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the settings directory.
#---------------------------------------------------------------------
# idea.config.path=${user.home}/.PyCharm/config
idea.config.path=自定义路径
# 该路径是PyCharm的一些配置,比如主题、字体等
#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the caches directory.
#---------------------------------------------------------------------
# idea.system.path=${user.home}/.PyCharm/system
idea.system.path=自定义路径
# 该路径是系统缓存和本地历史记录等
#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the user-installed plugins directory.
#---------------------------------------------------------------------
# idea.plugins.path=${idea.config.path}/plugins
# 不用修改,默认使用idea.config.path路径,该路径是PyCharm下载的插件
#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the logs directory.
#---------------------------------------------------------------------
# idea.log.path=${idea.system.path}/log
# 不用修改,默认使用idea.system.path路径,该路径是PyCharm的日志文件修改后,保存并退出。
旧数据迁移
PyCharm默认把这四个路径的数据保存在C盘,如果想要使用以前的配置数据就需要把C盘的数据迁移到刚刚配置的自定义路径下:
# Local路径存储的是系统数据 C:\Users\JohnS\AppData\Local\JetBrains\PyCharm2025.2 # Roaming路径存储的是配置数据 C:\Users\JohnS\AppData\Roaming\JetBrains\PyCharm2025.2
根据自己电脑的用户路径,打开上述路径:
- .\Local\JetBrains\PyCharm2025.2路径下的数据移动到idea.system.path定义的路径下;
- .\Roaming\JetBrains\PyCharm2025.2路径下的数据移动到idea.config.path定义的路径下。


重启PyCharm
重新启动PyCharm,就可以发现之前PyCharm的旧配置成功加载到新的PyCharm中了。
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
