install.packages("dplyr")
Installing package into ‘/usr/local/lib/R/3.6/site-library’
(as ‘lib’ is unspecified)
Error in install.packages : This version of R is not set up to install source packages
If it was installed from an RPM, you may need the R-devel RPM
Warning message:
In .rs.normalizePath(libPaths) :
path[2]="/usr/local/Cellar/r/3.6.3_1/lib/R/library": No such file or directory
OK, that means that the current state of configuration still thinks that it should be looking at the old $PATH; let me see what rearrangement of the search path makes sense
I think generally there's some kind of error which goes back to the codec on my computer.
When I type "conda install -c r r-dplyr" in the command line, I get this error,
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00000001195dd5c0 (most recent call first):
Abort trap: 6
There is something also messed up with my python path, which had caused a lot of trouble historically. I think homebrew caused it, but I don't know.
Oh! Anaconda is one of my all-time favorite apps! But it doesn't play well with R. That especially includes R and its packages.
That brings my eye to what needs to be changed in the $PATH variable.
From the terminal, go to your home directory
ls -la
Look for two files
.profile
.bash_profile
If you have both
cat profile
cat bash_profile
and you want to edit the one with the longest one.
Make a copy, such as
mv .profile .profile.SAVEme
If you use vi, that's fine, or any other command line editor. Or if outside the terminal, any app that can do plain text. If in doubt use TextEdit.
Carefully edit the applicable profile to move the piece with anaconda to the end. If there is another python directory, then move it to the end after anaconda.
I edited and saved it, and nothing seemed to change on the rstudio side of things, but I can easily close and open R or something if that's likely to change anything.
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x000000011a2785c0 (most recent call first):
This is exactly why I was so emphatic about backup
This is a complaint from Python and kinda illustrates the hazard involved in using Anaconda for both--potentially fixing one potentially breaks the other. Down in this S/O postqiix reports some experience with the same issue, but it wouldn't be prudent for me following you into Python environment configuration issues since it's been so long since I've used it.
Oof, yeah, I'm pretty sure that particular error was already there. Unfortunately it's come up a couple of times. But I have the backup, so that's nice too.
You've reached the point where when it happens to me I throw up my hands, nuke everything related, and start over again with fresh installs. I wish I could offer a clear path through that undergrowth and I've done this over the course of decades so I know both the pain of it and the dangers that lurk.