I am new to Mac OS, so this might be a silly question, but....

I just searched for $BaseDirectory and $UserBaseDirectory in my Mac OS El Captain, using the Finder. Neither directory is present apparently. For example, searching for


I cannot find the Library directory. Similar problem with


I can find the Library directory, but there is no Mathematica directory inside.

In Windows, the analogous directories are hidden. Is this the same in Mac OS too? If yes, how can I see them?

  • 3
    $\begingroup$ Don't know about Mac OS but what about SystemOpen @ $UserBaseDirectory? $\endgroup$
    – Kuba
    Mar 7, 2016 at 20:26
  • 3
    $\begingroup$ They are hidden. You can tell Finder to show hidden files and folders by entering a specific command in the Terminal: defaults write com.apple.finder AppleShowAllFiles YES and then relaunch the Finder. You can also use Mathematica's SystemOpen command to access them, as @Kuba suggested. $\endgroup$
    – Stefan R
    Mar 7, 2016 at 20:47
  • $\begingroup$ The directories you mention are not on in the usual places for $UserBaseDirectory and $BaseDirectory OS X. Did you do some kind of custom install? For instance, $BaseDirectory is usually /Library/Mathematica and this directory is not hidden in Yosemite. (I have not upgraded to El Capitan. $\endgroup$
    – m_goldberg
    Mar 8, 2016 at 0:26
  • $\begingroup$ @m_goldberg No custom install, I edited the paths and their status. I ultimately solved the problem following Kuba advice. But I first tried Stefan's trick (also found online): /Users/Alessandro/Library becomes visible but cannot be opened, while /Library/Mathematica simply does not exist. All in all the only reasonable solution seems to be Koba's SystemOpen one. All this is not easily found in the documentation. I am a bit disappointed by WRI. What is the point in making these important directories so hard to reach? $\endgroup$
    – magma
    Mar 8, 2016 at 9:44
  • 1
    $\begingroup$ SystemOpen[$BaseDirectory] returns $Failed: i'm using Mathematica 12.0 and macOS 10.15.4 $\endgroup$
    – Valerio
    Apr 22, 2020 at 17:02

4 Answers 4


Ok, so the quick way to find given directory is just to use SystemOpen @ dir. E.g.

 SystemOpen @ $UserBaseDirectory

I go there all the time so I added a menu to the main menu in order to not write this each time. Here's the procedure:

   (*aux function*)
dir = FileNameJoin[{ #, "SystemFiles", "FrontEnd", "TextResources",
    $OperatingSystem /. "MacOSX" -> "Macintosh"}] &;

   (*we are going to play inside $UserBaseDirectory to not break installation*)
   (*not everything from $ID is present in $USB so let's create that directory and file if that's necessary*)
If[Not @ DirectoryQ @ #, 
  CreateDirectory[#, CreateIntermediateDirectories -> True]
] & @ dir @ $UserBaseDirectory;

  FileNameJoin[{dir@$InstallationDirectory, "MenuSetup.tr"}],
  FileNameJoin[{dir@$UserBaseDirectory, "MenuSetup.tr"}]

SystemOpen @ FileNameJoin[{dir@$UserBaseDirectory, "MenuSetup.tr"}]

Now you have to add the menu anywhere you find it handy:


        MenuItem["$UserBaseDirectory", KernelExecute[ 
          SystemOpen[ $UserBaseDirectory] ], MenuEvaluator -> "System" ],
        MenuItem["$InstallationDirectory", KernelExecute[ 
         SystemOpen[ $InstallationDirectory] ], MenuEvaluator -> "System" ],
        MenuItem["$TemporaryDirectory", KernelExecute[ 
         SystemOpen[ $TemporaryDirectory] ], MenuEvaluator -> "System" ],
        MenuItem["NotebookDirectory[]",  KernelExecute[  
                ReplaceAll["FileName", NotebookInformation[SelectedNotebook[]]] =!=  "FileName", 
                SystemOpen[ NotebookDirectory[ SelectedNotebook[] ] ]
            MenuEvaluator -> "System"


Don't miss any comma etc. Save, restart MMA and be happy:

enter image description here

  • $\begingroup$ Great answer! Thanks $\endgroup$
    – magma
    Mar 10, 2016 at 2:35
  • $\begingroup$ This is useful code $\endgroup$
    – ktm
    Jan 5, 2018 at 22:50
  • $\begingroup$ @user6014 I'm glad it helps :) $\endgroup$
    – Kuba
    Jan 6, 2018 at 11:34
  • $\begingroup$ @Kuba: This may not work properly in upcoming Mathematica releases. (That a version 12 is on the way is no secret: In his frequent Twitch live-streaming "CEOing", he repeatedly refers to version 12.) Can you PM me to discuss this, since it's inappropriate to publicly deal with it right now? You'll find my email address at my web page math.umass.edu/directory/emeritus-faculty/murray-eisenberg. $\endgroup$
    – murray
    Nov 14, 2018 at 1:20
  • $\begingroup$ @murray it's 4 am here so I will contact you as soon as I hit the office later in the morning. $\endgroup$
    – Kuba
    Nov 14, 2018 at 2:45

On OS X, ~/Library is hidden by default (despite its name not starting with .). You can open it by clicking Go in the menu bar (Finder), then holding down the Option key. As soon as you press Option, Library appears in the list of locations you can "go to".

You can also hit Command-Shift-G in the Finder then type the path manually (or with Tab-completion) and hit Return. The location will be opened in the Finder even if it is hidden.

  • $\begingroup$ Good things to know, thanks $\endgroup$
    – magma
    Mar 10, 2016 at 2:33

In neither Wolfram Desktop nor Mathematica Home Edition does $BaseDirectory reference a directory/folder that exists on El Capitan.

Mathematica references /Library/Mathematica Wolfram Desktop references /Library/Wolfram Desktop

I am not sure, yet perhaps this is a defect caused by a missing tilde '~' which would you would expect to be expanded to reference the User domain aka ~/Library/Mathematica expanding to "/Users/foo/Library/Mathematica".

The short solution is to substitute $UserBaseDirectory in place of $BaseDirectory or, perhaps to reference the Application package itself /Applications/Mathematica.app/Contents/SystemFiles

I ran into the same problem while trying to figure out why my importer for Apple Mail emlx files must be explicitly referenced while calling Import rather than automatically loading as the documentation says it should.

EDIT: My answer concerns version 11. I have yet to verify that this case exists on 9 or 10

EDIT: Contrary to what others indicate, this is not an OS X issue. Mathematica 11 Home and Wolfram Desktop 11 references a Folder that does not exist, so clearing the 'hidden' attribute does nothing.

  • $\begingroup$ I have the same problem. I cannot see (nor via SystemOpen access) $BaseDirectory (/Library/Mathematica), even though I can see hidden folders in Finder. MacOS Sierra 10.12.6, Mathematica 11.2.0. $\endgroup$ Sep 24, 2017 at 9:11

Regarding the fact that SystemOpen[$BaseDirectory] returns $Failed, I contacted the Wolfram Technical Support and the answer is:

$BaseDirectory is normally for machines that are shared by several users so if you are the only user on the machine who uses Mathematica, then it's highly likely the directory won't exist.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.