Pycharm占用C盘空间越来越大 - 解决办法

方法1. 修改HOME\idea.properties

因为Pycharm项目缓存C:\Users\<username>\.PyCharm<2018.1>\system\caches下面的content.dat.storageData特别大,占用很多C盘空间,所以要想办法把这些设置移动到D盘

参考原文:https://intellij-support.jetbrains.com/hc/en-us/articles/207240985,可以实现

步骤:

1. 将C:\Users\<username>\.PyCharm<2018.1>下的所有文件复制到想要转移的位置(e.g. D:/Program Files/.PyCharmCE2018.1)

2. 在C:\Users\<username>\.PyCharm<2018.1>\config下新建一个idea.properties

# custom PyCharm properties

idea.config.path=D:/Program Files/.PyCharmCE2018.1/config
idea.system.path=D:/Program Files/.PyCharmCE2018.1/system

或者直接在

Pycharm里的Help/Edit Custom Properties的选项下面新建, 编辑内容同上。

3. 关闭Pycharm,删除c盘的目录:C:\Users\<username>\.PyCharm<2018.1>就可以省出一部分空间了。

方法二:修改IDE_HOME\bin\idea.properties文件

一般不用这个方法,因为如果更新了bin文件下的原始文件,更新补丁时可能会引起冲突。

可以创建一个idea.properties副本,以便IDE_HOME\bin下面的原始文件保持不变,并且在更新补丁期间不会引起冲突。

1.  在pycharm安装文件下的bin目录中, 复制idea.properties文件到C:\Users\<username>\.PyCharm<2018.1>\config

2. 编辑以下信息:

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.config.path=${user.home}/.PyCharmCE/config
idea.config.path=D:/Program Files/.PyCharmCE2018.1/config

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.system.path=${user.home}/.PyCharmCE/system
idea.system.path=D:/Program Files/.PyCharmCE2018.1/system

3. 如果需要,也可以用IDE指定的环境变量来覆盖idea.properties 文件的默认路径。

增加环境变量修改默认配置IDE的路径

IDE读取idea.properties文件的顺序如下:

  1. Environment variable - 环境变量 (IDEA_PROPERTIES)
  2. Default IDE configuration directory
  3. HOME\idea.properties (HOME 指的就是系统用户的home目录e.g. C:\Users\John\.PyCharm45\idea.properties)
  4. IDE_HOME\bin\idea.properties

idea.properties 文件的环境变量:

  • IDEA_PROPERTIES — IntelliJ IDEA
  • CLION_PROPERTIES — CLion
  • APPCODE_PROPERTIES — AppCode
  • PYCHARM_PROPERTIES — PyCharm
  • DATAGRIP_PROPERTIES — DataGrip
  • STUDIO_PROPERTIES — Android Studio
  • WEBIDE_PROPERTIES — WebStorm
  • PHPSTORM_PROPERTIES — PhpStorm
  • GOLAND_PROPERTIES — GoLand
  • RIDER_PROPERTIES — Rider

例如: IDEA_PROPERTIES=C:\Users\USER\idea.properties

  • 5
    点赞
  • 47
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值