0

我在 JupyterHub 终端中运行一个命令,该终端需要打开浏览器窗口才能完成 OAuth 流程。该命令似乎正在使用xdg-open其他途径来尝试打开 HTTP URL。此命令通过在 Chrome 中生成一个新选项卡在本地终端中运行。但是,当命令在 JupyerLab 终端中运行时,命令会失败:

david@ip-172-16-1-1:~$ google-drive-ocamlfuse -xdgbd
/usr/bin/xdg-open: 869: www-browser: not found
/usr/bin/xdg-open: 869: links2: not found
/usr/bin/xdg-open: 869: elinks: not found
/usr/bin/xdg-open: 869: links: not found
/usr/bin/xdg-open: 869: lynx: not found
/usr/bin/xdg-open: 869: w3m: not found
xdg-open: no method available for opening 'https://accounts.google.com/o/oauth2/auth?client_id=1234567890.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fgd-ocaml-auth.appspot.com%2Foauth2callback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&response_type=code&access_type=offline&approval_prompt=force&state=aabbccddeeffgghhii'
/bin/sh: 1: firefox: not found
/bin/sh: 1: google-chrome: not found
cannot open path of the current working directory: Permission denied
/bin/sh: 1: open: not found
Cannot retrieve auth tokens.
Failure("Error opening URL:https://accounts.google.com/o/oauth2/auth?client_id=1234567890.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fgd-ocaml-auth.appspot.com%2Foauth2callback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&response_type=code&access_type=offline&approval_prompt=force&state=aabbccddeeffgghhii")

我认为对于在浏览器中运行的 JupyterHub 来说,打开 URL 比典型的终端更容易。有没有办法让 Jupyter 处理终端命令打开 URL 的尝试?

4

0 回答 0