mirror of
https://github.com/clearml/clearml
synced 2025-03-10 05:50:13 +00:00
Fix Jupyter support on Windows host
This commit is contained in:
parent
e452709492
commit
089a4c66ff
@ -22,14 +22,14 @@ class ScriptInfo(object):
|
||||
|
||||
@classmethod
|
||||
def _get_jupyter_notebook_filename(cls):
|
||||
if not sys.argv[0].endswith('/ipykernel_launcher.py') or len(sys.argv) < 3 or not sys.argv[2].endswith('.json'):
|
||||
if not sys.argv[0].endswith(os.path.sep+'ipykernel_launcher.py') or len(sys.argv) < 3 or not sys.argv[2].endswith('.json'):
|
||||
return None
|
||||
|
||||
# we can safely assume that we can import the notebook package here
|
||||
try:
|
||||
from notebook.notebookapp import list_running_servers
|
||||
import requests
|
||||
current_kernel = sys.argv[2].split('/')[-1].replace('kernel-', '').replace('.json', '')
|
||||
current_kernel = sys.argv[2].split(os.path.sep)[-1].replace('kernel-', '').replace('.json', '')
|
||||
server_info = next(list_running_servers())
|
||||
r = requests.get(
|
||||
url=server_info['url'] + 'api/sessions',
|
||||
@ -44,7 +44,7 @@ class ScriptInfo(object):
|
||||
break
|
||||
|
||||
notebook_path = cur_notebook['notebook']['path']
|
||||
entry_point_filename = notebook_path.split('/')[-1]
|
||||
entry_point_filename = notebook_path.split(os.path.sep)[-1]
|
||||
|
||||
# now we should try to find the actual file
|
||||
entry_point = (Path.cwd() / entry_point_filename).absolute()
|
||||
|
@ -75,7 +75,7 @@ class Logger(object):
|
||||
self._report_worker = None
|
||||
self._task_handler = None
|
||||
|
||||
if DevWorker.report_stdout and not PrintPatchLogger.patched:
|
||||
if DevWorker.report_stdout and not PrintPatchLogger.patched and not running_remotely():
|
||||
Logger._stdout_proxy = PrintPatchLogger(sys.stdout, self, level=logging.INFO)
|
||||
Logger._stderr_proxy = PrintPatchLogger(sys.stderr, self, level=logging.ERROR)
|
||||
self._task_handler = TaskHandler(self._task.session, self._task.id, capacity=100)
|
||||
|
Loading…
Reference in New Issue
Block a user