dplyr installation issues

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

//anaconda3/bin://anaconda3/condabin:/Users/holysheets/.cargo/bin:/Applications/NEURON-7.5/nrn/x86_64/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin

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.

1 Like

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.

Report back?

drwxr-xr-x 3 holysheets staff 96 Aug 20 2019 .anaconda
-rw------- 1 holysheets staff 26294 Mar 27 12:04 .bash_history
-rw-r--r-- 1 holysheets staff 1105 Aug 20 2019 .bash_profile
-rw-r--r-- 1 holysheets staff 575 Dec 3 2018 .bash_profile-anaconda3.bak
drwx------ 226 holysheets staff 7232 Apr 8 14:36 .bash_sessions
[...]
-rw-r--r-- 1 holysheets staff 38 Dec 3 2018 .profile

I'm not exactly sure how to access these files, I'll try and treat them as though the dashes are just in their names.

The name you want is just plain .bash_profile

cat .profile
export PATH="$HOME/.cargo/bin:$PATH"
cat .bash_profile

This is referencing NEURON, which isn't important to my work anymore. I had been using NEURON, but I don't need it to be functional.

So, `.bash_profile is the one to work with. Here's mine. If you move everything that shows up in the

export PATH

lines to the end, that might do it.

But please back up .bash_profile so that it can be restored in case of mishap

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.

My bad, maybe.

Go to the terminal. If it's still open

$ source .bash_profile

will reset the path per your edits

then

$ echo $PATH 

should show the adjusted path

Then (WHAT, again???) close and reopen R

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 in response to the source .bash_profile

echo $PATH

/Users/holysheets/.cargo/bin:/Applications/NEURON-7.5/nrn/x86_64/bin://anaconda3/bin:/Users/holysheets/.cargo/bin:/Applications/NEURON-7.5/nrn/x86_64/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin://anaconda3/bin://anaconda3/condabin:/Users/holysheets/.cargo/bin:/Applications/NEURON-7.5/nrn/x86_64/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin

This is exactly why I was so emphatic about backup :grin:

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 post qiix 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.

Thanks for the help anyways.

1 Like

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.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.