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

Python3.5 and local installs #10

Open
leguyader opened this issue May 18, 2016 · 1 comment
Open

Python3.5 and local installs #10

leguyader opened this issue May 18, 2016 · 1 comment

Comments

@leguyader
Copy link

While trying to use rk, I run into the following problems:

  • python3.5 does not have raw_input(), instead it only has input() so I changed the corresponding 3 lines in the rk.py file.
  • In my local install of jupyter, the kernel folder is located in ~/.local/share/jupyter/kernels/ which is in a different place than the documentation gives.
  • For rk installed in user space, the rkscript should look for the configuration file with getusersitepackages() so I modified for my own purpose the rkscript to have
module_location = join(getusersitepackages(), module_name)
  • Then I got the ImportError: No module named IPython.kernel.zmq.kernelapp which is already reported. The solution was not immediate to me but eventually I found that I had to change argv in kernel.json to python3 to use my local python3 and not the global python2.7 install on the remote machine.

Did it work eventually ? Nope. Now I'm facing an strange issue. I can ssh into the remote machine without being asked for passphrase or password since the authentication is based on kerberos. Strangely enough, rk asks me first my passphrase, then my password and both eventually fail. Not sure what's causing this. Here is part of the log:

[I 12:04:27.899 NotebookApp] KernelRestarter: restarting kernel (4/5)
WARNING:root:kernel a251e120-4f06-485e-938f-5e60c1e11505 restarted
/usr/lib/python3.5/getpass.py:92: GetPassWarning: Can not control echo on the terminal.
  passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
remote's password: Traceback (most recent call last):
  File "/usr/lib/python3.5/getpass.py", line 70, in unix_getpass
    old = termios.tcgetattr(fd)     # a copy to save
termios.error: (25, 'Inappropriate ioctl for device')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "~/.local/bin/rkscript", line 230, in <module>
    paramiko_tunnel(v, remote_ports[k], remote_username_at_remote_host)
  File "~/.local/lib/python3.5/site-packages/rk/ssh/tunnel.py", line 321, in paramiko_tunnel
    password = getpass("%s's password: "%(server))
  File "/usr/lib/python3.5/getpass.py", line 92, in unix_getpass
    passwd = fallback_getpass(prompt, stream)
  File "/usr/lib/python3.5/getpass.py", line 127, in fallback_getpass
    return _raw_input(prompt, stream)
  File "/usr/lib/python3.5/getpass.py", line 149, in _raw_input
    raise EOFError
EOFError
[5897] Warning: unhandled RemoteError: Traceback (most recent call last):
  File "<string>", line 1072, in executetask
  File "<string>", line 1, in do_exec
  File "<remote exec>", line 55, in <module>
PermissionError: [Errno 13] Permission denied: '~/.ipython/profile_default/security/kernel-a251e120-4f06-485e-938f-5e60c1e11505.json'

Cheers.

@leguyader
Copy link
Author

Here some more infos.

First of all, I'm not sure why paramiko is used on my linux local machine. Reading the code in ssh/tunnel.py seems to suggest using it only on win32. Anyway, to get paramiko working with kerberos atuhentication, I modified in ssh/tunnel.py two lines in _try_passwordless_paramiko and in _paramiko_tunnel functions the call to client.connect by adding the argument gss_auth=True

This made things work. However, the remote machine I'm using are part of a pool of machines. If I configure the kernel.json with the pool name which then randomly redirect to a machine with low load, things don't quite work. If I modify the kernel.json to use the name of a specific machine in the pool, things work perfectly. I suspect that with the general pool name, several connections are made and each end up on a different machine, messing things up.

Cheers.

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

1 participant