Azure / Azure-TDSP-Utilities

Utilities and scripts developed as part of Microsoft's Team Data Science Process for productive data science
Creative Commons Attribution 4.0 International
373 stars 275 forks source link

Error in sys.frame(1) : not that many frames on the stack #1

Closed j450h1 closed 7 years ago

j450h1 commented 7 years ago

Hello there,

I'm trying to run this script on a Mac in Rstudio and I get this error message when running this line

script.dir <- dirname(sys.frame(1)$ofile) :

Error in sys.frame(1) : not that many frames on the stack

Here is the output from Sys.getenv if that helps:

`

Sys.getenv() __CF_USER_TEXT_ENCODING 0x1F5:0x0:0x0 Apple_PubSub_Socket_Render /private/tmp/com.apple.launchd.j6KVlXR0RP/Render DISPLAY /private/tmp/com.apple.launchd.PM723wEEf3/org.macosforge.xquartz:0 DYLD_FALLBACK_LIBRARY_PATH /Library/Frameworks/R.framework/Resources/lib:/Users/jas/lib:/usr/local/lib:/usr/lib:: EDITOR vi GIT_ASKPASS rpostback-askpass HOME /Users/jas LANG en_US.UTF-8 LC_CTYPE en_US.UTF-8 LN_S ln -s LOGNAME jas MAKE make PAGER /usr/bin/less PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/Library/TeX/texbin R_BROWSER /usr/bin/open R_BZIPCMD /usr/bin/bzip2 R_DOC_DIR /Library/Frameworks/R.framework/Resources/doc R_GZIPCMD /usr/bin/gzip R_HOME /Library/Frameworks/R.framework/Resources R_INCLUDE_DIR /Library/Frameworks/R.framework/Resources/include R_LIBS_SITE
R_LIBS_USER ~/Library/R/3.3/library R_PAPERSIZE a4 R_PDFVIEWER /usr/bin/open R_PLATFORM x86_64-apple-darwin13.4.0 R_PRINTCMD lpr R_QPDF /Library/Frameworks/R.framework/Resources/bin/qpdf R_RD4PDF times,inconsolata,hyper R_SESSION_TMPDIR /var/folders/_4/n0yjps8x5dv1qdkn7s2t2zr40000gn/T//RtmpjIKkAt R_SHARE_DIR /Library/Frameworks/R.framework/Resources/share R_SYSTEM_ABI osx,gcc,gxx,gfortran,? R_TEXI2DVICMD /usr/local/bin/texi2dvi R_UNZIPCMD /usr/bin/unzip R_ZIPCMD /usr/bin/zip RMARKDOWN_MATHJAX_PATH /Applications/RStudio.app/Contents/Resources/resources/mathjax-26 RS_RPOSTBACK_PATH /Applications/RStudio.app/Contents/MacOS/rpostback RS_SHARED_SECRET 51355adb-a590-4f62-9b6a-2882f6ca0e12 RSTUDIO 1 RSTUDIO_PANDOC /Applications/RStudio.app/Contents/MacOS/pandoc RSTUDIO_SESSION_PORT 29342 RSTUDIO_USER_IDENTITY jas RSTUDIO_WINUTILS bin/winutils SED /usr/bin/sed SHELL /bin/bash SSH_AUTH_SOCK /private/tmp/com.apple.launchd.Xd0PSFedE6/Listeners TAR /usr/bin/tar TMPDIR /var/folders/_4/n0yjps8x5dv1qdkn7s2t2zr40000gn/T/ USER jas XPC_FLAGS 0x0 XPC_SERVICE_NAME 0 YOUR_VAR abc123 `

hangzh-msft commented 7 years ago

Hi, j450h1,

Thanks for trying IDEAR, and your feedback.

To be honest, we have not tested it on Mac. We only tested it on Linux and Windows.

To make it work, a workaround will be:

  1. Comment out the line script.dir <- dirname(sys.frame(1)$ofile)
  2. Change the line setwd(script.dir) to setwd()

Then, it should start working.

Let us know if you run into other issues.

Hang

j450h1 commented 7 years ago

Yes, that helped. Thanks Hang and keep up the good work!

ssmohona commented 6 years ago

Hi I am seeing the same error in Rstudio using windows: setwd(dirname(sys.frame(1)$ofile)) Error in sys.frame(1) : not that many frames on the stack

setwd("~/Desktop/raw") Error in setwd("~/Desktop/raw") : cannot change working directory

setwd("../output") Error in setwd("../output") : cannot change working directory

How can I solve it