Closed razcore-rad closed 9 years ago
Well,
Make sure that you can login to a remote machine WITHOUT entering password:
$ ssh REMOTE_USERNAME@REMOTE_HOST
$ ssh razvan@fionn.ichec.ie
Change python interpreter:
{
"argv": [
"rkscript",
"python",
"{connection_file}",
"razvan@fionn.ichec.ie"
],
"display_name": "Fionn Python 2",
"language": "python"
}
It works? Install ipython3 notebook on a remote machine:
$ sudo apt-get install build-essential python-dev
$ sudo pip3 install 'ipython[notebook]'
Now, you can use python2 and python3 interpreters.
I do have password-less access. But, if I want to run ipython
(for python3
) shouldn't the interpreter be python3
? I can't have both python2
and python3
at the same time on the machine because the way it's set up (and I don't have root privileges). One more thing... why do you need the notebook since this works with kernels?!...
Why do you need the notebook since this works with kernels?
The rkscript, line #211:
launch_new_instance(["-f", remote_connection_file])
For ipython notebook:
from IPython.kernel.zmq.kernelapp import launch_new_instance
For jupyter notebook:
from ipykernel.kernelapp import launch_new_instance
This package and his dependencies must be available in Python 2 or/and Python 3 on a remote machine.
If I want to run ipython (for python3) shouldn't the interpreter be python3?
If you want enable Python 3 kernel for ipython/jupyter notebook in Python 2, for you need ipython/jupyter package in Python 3. Because cmd for launcher similarly with this command in ipython notebook ver. 3:
$ python3 -c "from IPython.kernel.zmq.kernelapp import main; main()" -f ".../kernel-73071367-fb6e-4bdf-8014-4eb2bc2df303.json"
or with this command:
$ python3 -m "IPython.kernel" -f ".../kernel-73071367-fb6e-4bdf-8014-4eb2bc2df303.json"
and with this command in jupyter notebook ver. 4:
$ python3 -m "ipykernel" -f "/run/user/1000/jupyter/kernel-73071367-fb6e-4bdf-8014-4eb2bc2df303.json"
Yes, I agree, but the notebook is only a frontend, you're communicating with the kernel so you don't need pip3 install ipython[notebook]
, pip3 install ipython
is enough...
Yes, I know all of those methods to run the kernels, I'm not entirely sure what exactly went wrong, but I moved on.. I implemented my own solution to the problem I had, thanks for the help anyway!
$ pip3 install ipython
is enough?
Yes, it is enough on a remote machine for python3 interpreter.
Thanks for the help anyway!
Thanks for your question.
So... I've been racking my brain about this and can't figure it out, please help?
I've seen the video on how to set it up... I am even getting connection errors when I specify a bad name in
kernel.json
. For example it asks me for my password if I specify the wrong user... all fine. Then I open up the terminal and doipython console --kernel fionn
, wherefionn
is (fromkernel.json
):I had to change one thing in
rkscript
, that is, I'm calling:makegateway("popen//service .profile//ssh=%s//python=%s"...
, without thepopen//service .profile//
it wouldn't work cause this machine uses loaded modules and a lot of environment variable setting up. Anyway... one more proof that I am connected properly, because withoutpopen//service .profile
it wouldn't work (so I think it's a good practice to read the.profile
or.bashrc
or both...) But then I go to the console and writeimport sys; sys.version
and I get3.4.3
which is the version on my local computer!... the office machine to which I want to connect to and run the kernel has3.4.0
. What am I missing here?!... Please help! (I've also tried addingpopen//service .profile
afterssh=%s
, but that didn't change anything...edit: oh yeah... to be sure I also checked
sys.path
so this returns the local path... instead of the office machine path.edit: I noticed one more thing. I'm getting:
Port forwarding stopped uncleanly: [Errno 98] Address already in use
. Might this mean that the connection isn't properly set up and I end up with the commands being executed on my local machine?some more details So the way I connect to my work machine is through VPN and another machine so, my
.ssh/config
looks like this:And I connect to
fionn
to work...