0

I have installed docker and image of splash by

docker pull scrapinghub/splash

and started the container by

docker run -p 8050:8050 -p 5023:5023 scrapinghub/splash

which its result can be seen in the picture below enter image description here

but, the problem is that in R after running install_splash() I receive this error:

Error: Python module docker was not found.

Detected Python configuration:

python:         C:\Users\m-joudy\AppData\Local\Programs\Python\Python36\\python.exe
libpython:      C:/Users/m-joudy/AppData/Local/Programs/Python/Python36/python36.dll
pythonhome:     C:\Users\m-joudy\AppData\Local\Programs\Python\Python36
version:        3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]
Architecture:   64bit
numpy:           [NOT FOUND]
docker:         [NOT FOUND]

python versions found: 
 C:\Users\m-joudy\AppData\Local\Programs\Python\Python36\\python.exe
 C:\Users\m-joudy\AppData\Local\Programs\Python\PYTHON~1\\python.exe 
mjoudy
  • 149
  • 1
  • 1
  • 10

1 Answers1

0

From splashr's README we learn that the docker commands you used and install_splash() are alternatives, i.e. after

docker pull scrapinghub/splash
docker run -p 8050:8050 -p 5023:5023 scrapinghub/splash

you should be ready to use

library(splashr)
splash_active()

and be set to use splash via splashr. If you still want to make install_splash() work, then the error message you quoted tells us, that the python modules docker and numpy are missing. How you install python packages depends on your installation, but one poular way is to use pip, i.e.

pip install numpy
pip install docker

Potentially within a virtual environment.

Ralf Stubner
  • 26,263
  • 3
  • 40
  • 75
  • after commands `library(splashr)` and `splash_active()`, I receive `FALSE` .How should I set to use `splash` via `splashr` ? – mjoudy May 03 '18 at 13:01
  • @mjoudy Was the docker container running when you tried these commands? This works out of the box on my Linux machine. – Ralf Stubner May 03 '18 at 13:10
  • 1
    Also, what is the output of `jsonlite::fromJSON("http://localhost:8050/_ping")` when the docker container is running? – Ralf Stubner May 03 '18 at 13:24
  • yes, it is running! the last state of docker is like the above picture. And, I am wondering if should it be like that? I mean, in this state there is not any possibility to write a new command. – mjoudy May 03 '18 at 13:24
  • it is the output: `> jsonlite::fromJSON("http://localhost:8050/_ping")` `Error in open.connection(con, "rb") : Failed to connect to localhost port 8050: Connection refused` – mjoudy May 03 '18 at 13:26
  • 1
    @mjoudy Docker on Windows seems to be different. This might help: https://stackoverflow.com/questions/37891939/docker-running-splash-container-but-localhost-does-not-load-windows-10 – Ralf Stubner May 03 '18 at 13:28