Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: package or namespace load failed for ‘haven’ in dyn.load(file, DLLpath = DLLpath, …): #363

Closed
tidyx opened this issue Mar 15, 2018 · 14 comments

Comments

@tidyx
Copy link

@tidyx tidyx commented Mar 15, 2018

I am not able to open install the 'haven' packages. It gives me the following error:

*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘haven’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/R/R/x86_64-redhat-linux-gnu-library/3.4/haven/libs/haven.so':
/home/R/R/x86_64-redhat-linux-gnu-library/3.4/haven/libs/haven.so:undefined symbol: libiconv
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/R/R/x86_64-redhat-linux-gnu-library/3.4/haven’
Warning in install.packages :
installation of package ‘haven’ had non-zero exit status

The downloaded source packages are in
‘/tmp/Rtmp4y5PTv/downloaded_packages’

I have also tried to remove and re-install it, but without success.

install.packages('haven', dep = TRUE)
@HoseinHashemi
Copy link

@HoseinHashemi HoseinHashemi commented May 4, 2018

Try specifying the repository. Sometimes install.packages cannot find the right repository.

@hadley hadley closed this as completed Jun 8, 2018
@MajoroMask
Copy link

@MajoroMask MajoroMask commented Aug 23, 2018

For people who googled to here, you may try this:
withr::with_makevars(c(PKG_LIBS = "-liconv"), install.packages("haven"), assignment = "+=")
It seems someone create a typo in somewhere.

@zhuangfjnu
Copy link

@zhuangfjnu zhuangfjnu commented Aug 27, 2018

Thank MajoroMask!
very useful information!

@inesHellmann
Copy link

@inesHellmann inesHellmann commented Aug 29, 2018

Thanx a MajorMask! This was driving me crazy.

@sgmccalla
Copy link

@sgmccalla sgmccalla commented Nov 28, 2018

Thank you @MajoroMask! I was able to install haven finally.

@yangkl0909
Copy link

@yangkl0909 yangkl0909 commented Feb 12, 2019

Thank you @MajoroMask! Very useful suggestion.

@marcora
Copy link

@marcora marcora commented Feb 22, 2019

Why is this issue closed? I specify the right repository and I still have the same problem!
Doing what MajoroMask suggested fixes the issue temporarily, but this is hardly resolved!

@hadley
Copy link
Member

@hadley hadley commented Feb 23, 2019

Because I didn’t know it was a problem — generally comments on closed issues go unread.

@MaxGhenis
Copy link

@MaxGhenis MaxGhenis commented Apr 16, 2019

I hit the same error with the readxl package after resolving the haven one with @MajoroMask's solution. Applying the same to readxl worked:
withr::with_makevars(c(PKG_LIBS = "-liconv"), install.packages("readxl"), assignment = "+=")

I installed tidyverse via conda.

@arinbasu
Copy link

@arinbasu arinbasu commented Jun 16, 2019

I had the same problem, I solved it by removing haven and reinstalling tidyverse.
Now it works (fingers crossed).
So I did:
conda remove r-haven
conda will remove haven but will also ask to remove r-essentials and r-tidyverse
Remove these as well.
Then re-install tidyverse, with
conda install r-tidyverse
(This time do not specify conda-forge, do not use the option -c conda-forge)
A newer version of haven will be installed and this solved my problem.

@hadley
Copy link
Member

@hadley hadley commented Jun 16, 2019

If you use conda, you must use conda to install everything else. You can not mix install.packages() and conda install

@aakhmetz
Copy link

@aakhmetz aakhmetz commented Jun 20, 2019

I mix conda install and install.packages() quite a lot, and there is no problem. @MaxGhenis solution worked for me

@hadley hadley closed this as completed Jun 20, 2019
@inesHellmann
Copy link

@inesHellmann inesHellmann commented Jul 4, 2019

I just updated all packages on R 3.6.0 on our centos server -- just R, no conda. When installing haven and readxl, I am still getting the same error message as a year ago: undefined symbol: libiconv
which can be fixed by the MajoroMask suggestion.

roryk added a commit to roryk/r-readxl-feedstock that referenced this issue Oct 9, 2019
This issue was fixed for `haven` but still exists for the `readxl` package.
See tidyverse/haven#363 for more information.
@lock
Copy link

@lock lock bot commented Jan 1, 2020

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests