albermax / innvestigate

A toolbox to iNNvestigate neural networks' predictions!
Other
1.25k stars 233 forks source link

nboncvert.py requires global installation of jupyter #108

Closed sebastian-lapuschkin closed 5 years ago

sebastian-lapuschkin commented 5 years ago

log:

python3 nbconvert.py to_script
Convert notebook: imagenet_compare_methods.ipynb
Traceback (most recent call last):
  File "nbconvert.py", line 79, in <module>
    subprocess.check_call(call)
  File "/usr/lib/python3.5/subprocess.py", line 576, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.5/subprocess.py", line 557, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/jupyter'

I propose to change the contents of lines 31-32

#bin_dir = os.path.dirname(sys.executable)
#jupyter_executable = os.path.join(bin_dir, "jupyter")

with functionality locating any callable installation of jupyter, eg as

jupyter_executable = subprocess.check_output(['which jupyter'], shell=True).strip()
albermax commented 5 years ago

Hi! Thanks for the fix!

The intention of line 31-32 is to find the jupyter executable of a potential python virtual environment.

I will change the code to try first line 31-32 and then fallback to your proposition! Thanks!

albermax commented 5 years ago

Fixed in develop branch.