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

Cannot install tidycensus package without first installing rgdal package #98

Closed
purdiea opened this issue Aug 16, 2018 · 2 comments
Closed

Comments

@purdiea
Copy link

purdiea commented Aug 16, 2018

I attempted to install the tidycensus package but received the following error. To solve it, I ran install.packages('rgdal') first and then was able to install tidycensus. Can you add rgdal to the dependencies when downloading tidycensus to avoid this issue in the future?

>install.packages('tidycensus')


There is a binary version available but the source version is later:
           binary source needs_compilation
tidycensus    0.4  0.4.6             FALSE
installing the source package ‘tidycensus’
trying URL 'https://cran.rstudio.com/src/contrib/tidycensus_0.4.6.tar.gz'
Content type 'application/x-gzip' length 1615516 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

* installing *source* package ‘tidycensus’ ...
** package ‘tidycensus’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgdal/libs/rgdal.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgdal/libs/rgdal.so, 6): Library not loaded: /Applications/Postgres.app/Contents/Versions/10/lib/libgdal.20.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgdal/libs/rgdal.so
  Reason: image not found
ERROR: lazy loading failed for package ‘tidycensus’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/tidycensus’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/tidycensus’
Warning in install.packages :
  installation of package ‘tidycensus’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/__/3095ysy154lgtsnjdz_zp1vc0000gq/T/RtmpqS6n7p/downloaded_packages’```
@walkerke
Copy link
Owner

rgdal should get picked up by tigris when tidycensus installs as it is a dependency of that package. What operating system are you on?

@simplymathematics
Copy link

Reporting the same issue on Ubuntu 18.04 running R 3.6. Fixed by running

sudo apt install libgdal-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants