DS4PS / cpp-526-spr-2021

Course shell for Foundations of Data Science I
https://ds4ps.org/cpp-526-spr-2021/
MIT License
1 stars 2 forks source link

Knitting Lab 1 #1

Open aawoods97 opened 3 years ago

aawoods97 commented 3 years ago

Hi! I am having trouble knitting lab 1. When I click the knit button at the top of the screen, but I receive the following message "Rendering R Markdown documents requires an updated version of the htmltools package." I click the button to install the package. I receive a message in the console that says that it has been properly installed. However, when I click the button to knit the file, the message appears again and I repeat the process to no avail. I have also tried quitting RStudio and restarting it, but that does not work either.

Is there something else that I need to do?

lecy commented 3 years ago

Can you please provide the R text you see when updating the htmltools package? And the error messages when trying to knit?

I suspect that the install is failing because you cannot remove the previous version of htmltools. Without having additional information to properly assess the situation, I might suggest closing R Studio, open a basic R console, then install htmltools from there:

install.packages( "htmltools" )

R Studio needs to load some packages for some functionality in the user interface, so new installs fail because the old version is active and thus can't be removed properly. Using the R console can circumvent this problem.

aawoods97 commented 3 years ago
Screen Shot 2021-01-12 at 7 50 07 PM

This is the error I am getting.

lecy commented 3 years ago

Got it - you are running into a dependency problem. The package "xcrun" is not working, so the new version of htmltools cannot be installed.

If you search the error text you find:

https://community.rstudio.com/t/xcrun-error-invalid-active-developer-path-library-developer-commandlinetools-missing-xcrun-at-library-developer-commandlinetools-usr-bin-xcrun-error-compilation-failed-for-package-rlang/27553/3

I assume you are using a mac then? Looks like you need to install xcode on your mac for it to be able to install the R packages correctly. This is a mac problem - macs can be tricky.

https://www.embarcadero.com/starthere/berlin/mobdevsetup/ios/en/installing_xcode_on_a_mac.html

Then re-install rlang and see if it fixes the problem.

install.packages( "rlang" )
# might need to try installing html tools again after rlang is updated?
aawoods97 commented 3 years ago

I finally got it to work. Thank you for your help!

lecy commented 3 years ago

Just curious, was it xcode?

aawoods97 commented 3 years ago

I believe it was. I downloaded Xcode, reopened R and installed the “htmltools” and “rlang” libraries and it worked from there.

cinscott commented 3 years ago

I was running into the same issue. I downloaded Xcode and reopened R, but when I tried installing htmltools I received the following error message. Any thoughts on what I need to do?

Installing 'htmltools' for R Markdown...
  There is a binary version available but the source version is later:
          binary source needs_compilation
htmltools  0.5.0  0.5.1              TRUE
installing the source package ‘htmltools’

trying URL 'https://cran.rstudio.com/src/contrib/htmltools_0.5.1.tar.gz'
Content type 'application/x-gzip' length 71528 bytes (69 KB)
==================================================
downloaded 69 KB

* installing *source* package ‘htmltools’ ...
** package ‘htmltools’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘htmltools’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/htmltools’
lecy commented 3 years ago

@cinscott You are on a mac as well?

When you say you downloaded Xcode, did you install it without problems? Not sure if you would need to re-start as well for settings to update.

Did you install rlang before re-installing htmltools?

@aawoods97 any advice?

cinscott commented 3 years ago

I am on a mac. I didn't install rlang first, but I did restart R. I'll try installing rlang first.

Thanks!

On Wed, Jan 13, 2021 at 2:17 PM Jesse Lecy notifications@github.com wrote:

@cinscott https://github.com/cinscott You are on a mac as well?

When you say you downloaded Xcode, did you install it without problems? Not sure if you would need to re-start as well for settings to update.

Did you install rlang before re-installing htmltools?

@aawoods97 https://github.com/aawoods97 any advice?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DS4PS/cpp-526-spr-2021/issues/1#issuecomment-759744819, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM6JOQJ4PLRJXGEONENBA23SZYEWJANCNFSM4V76YUKQ .

lecy commented 3 years ago

@cinscott please let us know if that works

aawoods97 commented 3 years ago

@cinscott I am also working on a mac. I had to open code, create a new code project and a folder to store it in. Restart Rstudio. I believe next I tried to install rlang, but I received the same error as before so I installed htmltools first then rlang and it worked. I hope this helps!

cinscott commented 3 years ago

@aawoods97 Thank you! I'll see if I muddle through this...appreciate all the help!

jamisoncrawford commented 3 years ago

@lecy thanks for helping out!