mirror of
https://github.com/clearml/clearml
synced 2025-02-02 01:54:23 +00:00
Fix jupyter notebook cannot be detected
This commit is contained in:
parent
e65b800e93
commit
8b652ebec1
@ -556,10 +556,17 @@ class ScriptInfo(object):
|
||||
# we can safely assume that we can import the notebook package here
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
# noinspection PyPackageRequirements
|
||||
from notebook.notebookapp import list_running_servers
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
# noinspection PyPackageRequirements
|
||||
from notebook.notebookapp import list_running_servers # <= Notebook v6
|
||||
except Exception:
|
||||
# noinspection PyPackageRequirements
|
||||
from jupyter_server.serverapp import list_running_servers
|
||||
|
||||
import requests
|
||||
current_kernel = sys.argv[2].split(os.path.sep)[-1].replace('kernel-', '').replace('.json', '')
|
||||
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
server_info = next(list_running_servers())
|
||||
|
Loading…
Reference in New Issue
Block a user