Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stata does not find the location of an ado file

    Hi all,

    I've been struggling with the following problem. When I use the sysdir command to get the system directories I get the following:

    sysdir
    STATA: C:\Users\cater\Desktop\Stata15\
    BASE: C:\Users\cater\Desktop\Stata15\ado\base\
    SITE: C:\Users\cater\Desktop\Stata15\ado\site\
    PLUS: c:\ado\plus\
    PERSONAL: c:\ado\personal\
    OLDPLACE: c:\ado\
    In particular, this interests me because I've installed the ceq package from SSC in Stata 15.1 and it was stored in PLUS directory and because I've been working on modifying some of the ado files the package contains and I've been storing the modified ado files in the PERSONAL directory.

    Now, I'm currently working with the ceqppp.do file and I can see it stored in the PERSONAL directory when I look for it in my computer but when I use the -which- command or the -findfile- command, neither of them finds the location. More specifically, I get the following output:


    which ceqppp2
    .\ceqppp2.ado
    *! v1.0 22nov2015
    or

    findfile ceqppp2.ado
    ./ceqppp2.ado
    where ceqppp2.ado is the name of the modified version.

    The weird thing is that even though Stata doesn't seem to find a location, it does run the ado file. So it must find somewhere/somehow.

    Also, another weird thing is that when I use both commands to find the location of any other ado files, it works perfectly fine (both for ados saved in PLUS and PERSONAL directories).

    Could it be a problem with the ado file?

    Alternatively, is it possible to tell Stata which is the directory of the ado?

    Thanks!

  • #2
    Before proceeding further, try adding the "all" option to your command:

    Code:
    which ceqppp2, all
    Sometimes copies can be lurking where you don't expect them. I have a hunch something different is going on here, but this is an easy thing to try!

    PS please use CODE delimiters (# button) rather than quote tag wrapping (" button) -- it makes your output more legible. (See Forum FAQ)

    Comment


    • #3
      Many thanks, Stephen Jenkins! using the "all" option, I could see that Stata finds several copies, one of which is in the path I was expecting it to be. Following this, I tried running the same code on another computer, which has no other copies of the ado file, and the code runs perfectly fine. So, it seems the copies are indeed the problem.

      Comment


      • #4
        Note that rather than the sysdir command you wanted the adopath command. On my system, we can see that the current working directory (".") takes precedence over other user-installed software.
        Code:
        . sysdir
           STATA:  /Applications/Stata/
            BASE:  /Applications/Stata/ado/base/
            SITE:  /Applications/Stata/ado/site/
            PLUS:  /Users/lisowskiw/Library/Application Support/Stata/ado/plus/
        PERSONAL:  /Users/lisowskiw/Library/Application Support/Stata/ado/personal/
        OLDPLACE:  ~/ado/
        
        . adopath
          [1]  (BASE)      "/Applications/Stata/ado/base/"
          [2]  (SITE)      "/Applications/Stata/ado/site/"
          [3]              "."
          [4]  (PERSONAL)  "/Users/lisowskiw/Library/Application Support/Stata/ado/personal/"
          [5]  (PLUS)      "/Users/lisowskiw/Library/Application Support/Stata/ado/plus/"
          [6]  (OLDPLACE)  "~/ado/"

        Comment


        • #5
          William Lisowski I only read your message now. Thanks! And indeed, I get the same result when I use the -adopath- command

          Comment

          Working...
          X