As I finally realized that, to install a rpy2 package on Windows is almost a mission impossible, I decide to install a ipython notebook server on the remote machine instead. So I can generate the R script from python and run by "R cmd run run.r". Naive, but it works...
The offical website suggest to use SSL in login, however, I may have to use the server with public computer. So password login should be more convenient.
Here is the step:
1. First, create a hashed password.
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[3]: 'sha1:5dd097...'
2. Create a custom profile for the notebook, with the following command line, type:
$ ipython profile create nbserver
3. Change the Config file(ipython_notebook_config.py), add the following lines,
c = get_config()
# Kernel config
c.IPKernelApp.pylab = 'inline' # if you want plotting support always
# Notebook config
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha1:5dd097...'[the hashed password generated by IPython.lib.passwd]'
# Define a port
c.NotebookApp.port = 8888
4. Make it run:
ipython notebook --profile=nbserver
Then the server can be accessed by using the "http://server_IP:8888" , you will have to enter the password for login.
Comments
comments powered by Disqus