Fatal error: cannot mkdir R_TempDir

前端 未结 6 1690
有刺的猬
有刺的猬 2021-02-07 00:53

When attempting to run R, I get this error:

Fatal error: cannot mkdir R_TempDir

I found two possible fixes for this problem by goog

相关标签:
6条回答
  • 2021-02-07 01:14

    Your default temporary directory appears to have the wrong permissions. Here I have

    $ ls -ld /tmp
    drwxrwxrwt 22 root root 4096 2011-06-10 09:17 /tmp
    

    The key part is 'everybody' can read or write. You need that too. It certainly can contain subdirectories.

    Are you running something like AppArmor or SE Linux?

    Edit 2011-07-21: As someone just deemed it necessary to downvote this answer -- help(tempfile) is very clear on what values tmpdir (the default directory for temporary files or directories) tries:

    By default, 'tmpdir' will be the directory given by 'tempdir()'. This will be a subdirectory of the temporary directory found by the following rule. The environment variables 'TMPDIR', 'TMP' and 'TEMP' are checked in turn and the first found which points to a writable directory is used: if none succeeds '/tmp' is used.

    So my money is on checking those three environment variables. But AppArmor and SELinux have shown to be an issue too on some distributions.

    0 讨论(0)
  • 2021-02-07 01:18

    Dirk is right, but misses a point: If /tmp is full, you can't create subdirectories there. Try

    df /tmp
    

    I just hit this on a shared server, where /tmp is mounted on it's own partition, and is shared by many users. In this particular case, you can't really see who's fault it is, because permissions restrict you seeing who is filling up the tmp partition. Basically have to ask the sys admins to figure it out.

    0 讨论(0)
  • 2021-02-07 01:19

    Go to your user directory and create a file called .Renviron and add the following line, save it and reopen RStudio or Rgui or Rterm

    TMP = '<path to folder where Everyone has full control>'
    

    This worked with me on Windows 7

    0 讨论(0)
  • 2021-02-07 01:24

    Check for the user account with which you are launching the RStudio with. Now u check the TMP(System Environment variable) for its location. If the user who is launching RStudio has Write access for those directories you will not face this issue. Being said that you are facing this issue, all you have to do is to change the permissions for that user to have write access on those directories.

    0 讨论(0)
  • 2021-02-07 01:25

    Just had this issue and finally solved it. Simply a windows permission issue. Go to environment variables and find the location of the temp folders. Then right click on the folder > properties > security > advanced > change everyone to full control > tick "replace all child object permission entries with inheritable permission entries from this object" > Ok > ok.

    0 讨论(0)
  • 2021-02-07 01:26

    This will also happen when your computer is completely, utterly out of space. Currently, my Mac has 0 kb free and it's causing this error. Freeing up some space solved the problem.

    0 讨论(0)
提交回复
热议问题