Opened 5 years ago

Closed 20 months ago

#2145 closed defect (fixed)

R Jupyter demo errors

Reported by: darkblueb Owned by: osgeolive@…
Priority: normal Milestone: OSGeoLive16.0
Component: OSGeoLive Keywords: R, sf
Cc:

Description

Steps to reproduce:

  • boot Live13 a2
  • start the Jupyter system
  • run the R Notebook
  • execute each cell
library('sf') #SimpleFeature Library to handle shapefiles

  Linking to GEOS 3.7.0, GDAL 2.4.0, PROJ 5.2.0

  Package: sf
  Version: 0.7-4
  Title: Simple Features for R

The demo dot-shp file loads properly, but the first call to display data fails.

ERROR while rich displaying an object: Error in loadNamespace(name): there is no package called ‘geojsonio’

Traceback:
1. FUN(X[[i]], ...)
2. tryCatch(withCallingHandlers({
 .     if (!mime %in% names(repr::mime2repr)) 
 .         stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
 .     rpr <- repr::mime2repr[[mime]](obj)
 .     if (is.null(rpr)) 
 .         return(NULL)
 .     prepare_content(is.raw(rpr), rpr)
 . }, error = error_handler), error = outer_handler)
3. tryCatchList(expr, classes, parentenv, handlers)
4. tryCatchOne(expr, names, parentenv, handlers[[1L]])
5. doTryCatch(return(expr), name, parentenv, handler)
6. withCallingHandlers({
 .     if (!mime %in% names(repr::mime2repr)) 
 .         stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
 .     rpr <- repr::mime2repr[[mime]](obj)
 .     if (is.null(rpr)) 
 .         return(NULL)
 .     prepare_content(is.raw(rpr), rpr)
 . }, error = error_handler)
7. repr::mime2repr[[mime]](obj)
8. repr_geojson.sf(obj)
9. repr_geojson(geojsonio::geojson_list(obj), ...)
10. geojsonio::geojson_list
11. getExportedValue(pkg, name)
12. asNamespace(ns)
13. getNamespace(ns)
14. tryCatch(loadNamespace(name), error = function(e) stop(e))
15. tryCatchList(expr, classes, parentenv, handlers)
16. tryCatchOne(expr, names, parentenv, handlers[[1L]])
17. value[[3L]](cond)

An attempt to separately load geojsonio fails in multiple ways

> install.packages('geojsonio')
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘hms’, ‘BH’, ‘protolite’, ‘rgdal’, ‘rgeos’, ‘maptools’, ‘readr’, ‘V8’, ‘geojson’, ‘jqr’
...

trying URL 'https://cloud.r-project.org/src/contrib/geojson_0.3.2.tar.gz'
...
trying URL 'https://cloud.r-project.org/src/contrib/geojsonio_0.7.0.tar.gz'
...

Attachments (2)

jupyter_ir_o13_debug.txt.bz2 (12.2 KB ) - added by darkblueb 5 years ago.
jupyter_ir_o12_debug.txt.bz2 (11.2 KB ) - added by darkblueb 5 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 by wildintellect, 5 years ago

I looked into this a while back when you mentioned it. If I recall Jupyter has it's own code for printing/plotting which adds the geojsonio package dependency. From the initial list provided, V8 does have a system dependency of 'libv8-dev or libnode-dev'

Can you provide all the errors when trying to install geojsonio? That should tell us if any of the other packages are missing system libraries.

comment:2 by darkblueb, 5 years ago

attaching two DEBUG logs, one from o12 (works), the second from o13 (fails)

duplicate of ticket #2134

by darkblueb, 5 years ago

by darkblueb, 5 years ago

comment:3 by darkblueb, 5 years ago

previous comment by wildintellect

The cause is the IRKernel specifies that geojsonio package is used to display various things from sf objects. This is specific to Jupyter. Easiest solution is to add the geojsonio R library and it's dependencies. Not sure how much space this will take. This does include need to add the system V8 library.

sudo apt-get install libv8-dev

https://github.com/IRkernel/repr/search?q=geojsonio&unscoped_q=geojsonio

comment:4 by darkblueb, 5 years ago

Can you provide all the errors when trying to install geojsonio? That should tell us if any of the other packages are missing system libraries.

per the attached DEBUG logs, R modules rgdal and rgeos are not installed at all in the working osgeolive 12 final edition. It seems a bad indicator that rgdal and rgeos are being queued for install, as if this method of installation is wholly out of synch with the current setup.

comment:5 by darkblueb, 5 years ago

osgeolive beta1 / sf 0.7-6 ; does draw, albeit with long warning text; sf team on the topic, will update status here

comment:6 by darkblueb, 5 years ago

Priority: criticalnormal

comment:7 by kalxas, 5 years ago

Milestone: OSGeoLive13.0OSGeoLive14.0

Ticket retargeted after milestone closed

comment:8 by darkblueb, 4 years ago

R sf osgeolive 14.0

Linking to GEOS 3.9.0, GDAL 3.2.1, PROJ 7.2.0

the above-mentioned geojson-io error msgs persists

comment:9 by kalxas, 4 years ago

Milestone: OSGeoLive14.0OSGeoLive15.0

Ticket retargeted after milestone closed

comment:10 by darkblueb, 3 years ago

updating for ol15

comment:11 by darkblueb, 2 years ago

build 96 jupyter/notebook_gallery/R/R_spatial_introduction.ipynb

    sids <- st_read(dsn = "/usr/lib/python3/dist-packages/pysal/lib/examples/sids2/sids2.shp" )

    head(sids)   ## ERROR while rich displaying an object: Error in loadNamespace(x): there is no package called ‘geojsonio’

the demo does draw using ggplot2 (small)

Last edited 2 years ago by darkblueb (previous) (diff)

comment:12 by darkblueb, 2 years ago

Summary: R Jupyter demo FailsR Jupyter demo errors

comment:13 by darkblueb, 2 years ago

ol15 vmdk beta1

large warnings : "... there is no package called 'geojsonio' "

GEOS 3.10.2  GDAL 3.4.3  PROJ 8.2.1  sf_use_s2() is TRUE

comment:14 by kalxas, 2 years ago

Milestone: OSGeoLive15.0OSGeoLive16.0

Ticket retargeted after milestone closed

comment:15 by darkblueb, 20 months ago

Resolution: fixed
Status: newclosed

fixed in ol16 alpha 3

Note: See TracTickets for help on using tickets.