Announcement

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

  • Using 7z in Stata (through terminal or shell command)

    Dear Statalist users,

    I am trying to unzip a large number of .7z files in Stata. I am a MAC OS users, I downloaded the 7zip package from Homebrew following these steps and I can now easily unzip 7zip files in my terminal. However when I am trying to execute these commands in the Stata terminal it fails. I get the following error message:

    Code:
    shell 7z e bilans_saisis_20200312.7z
    
    zsh:1: command not found: 7z
    It seems the shell command cannot be used with 7z. I am aware of the unzipfile command but I don't think it is working with 7z. I am not an expert of the shell command nor of using terminal commands in Stata but does someone have an idea of how to unzip 7zip using Stata on Mac OS ? Is there a way to at least call the terminal from Stata and unzip all my files ? I know it is possible for Windows users but I can't get a way of doing the same thing for Mac OS users. I am using Stata 14.

    Thank you,
    Nicolas

  • #2
    I'm not a Mac user, but is the 7zip binary in your system path?

    Comment


    • #3
      I am a Mac user. The problem is that the shell started by Stata does not inherit the same PATH as the terminal shell.

      From Stata:
      Code:
      . shell echo \$PATH
      
      /usr/bin:/bin:/usr/sbin:/sbin:/Users/lisowskiw/bin:/Applications/Stata/StataSE.app/Contents/MacOS
      From Terminal, reflecting a customization to my shell environment made by an app I installed:
      Code:
      lisowskiw 2% echo $PATH
      /usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Users/lisowskiw/bin:/Applications/Stata/StataSE.app/Contents/MacOS
      Probably the easiest solution is to replace 7z with the full path to the executable program in your Stata shell command.



      Comment


      • #4
        Hi all,
        I'm sorry for the off-topic; I will try here since there are not many posts.

        Since I am about to change my (Windows-based) laptop, I wondered what your experience with Stata on Mac and whether you would recommend it to others was. As a Windows user, I am afraid of these freezes, and I'd like to know whether shifting from Windows to Mac is worth it.

        What Mac/iOS configuration and Stata do you have? How many observations do you usually have in your datasets? What packages/commands do you use? Does it crash (often)?

        Thanks for your time,
        Luigi

        Comment

        Working...
        X