marcotcr / checklist

Beyond Accuracy: Behavioral Testing of NLP models with CheckList
MIT License
2.01k stars 204 forks source link

Checklist viewer installation fails in macintosh #21

Closed krishnadurai closed 4 years ago

krishnadurai commented 4 years ago
jupyter nbextension install --py --user checklist.viewer

Results in:

Installing test/lib/python3.7/site-packages/checklist/viewer/static -> viewer
Making directory: user/Library/Jupyter/nbextensions/viewer/
Traceback (most recent call last):
  File "test/bin/jupyter-nbextension", line 8, in <module>
    sys.exit(main())
  File "test/lib/python3.7/site-packages/jupyter_core/application.py", line 270, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "test/lib/python3.7/site-packages/traitlets/config/application.py", line 664, in launch_instance
    app.start()
  File "test/lib/python3.7/site-packages/notebook/nbextensions.py", line 983, in start
    super(NBExtensionApp, self).start()
  File "test/lib/python3.7/site-packages/jupyter_core/application.py", line 259, in start
    self.subapp.start()
  File "test/lib/python3.7/site-packages/notebook/nbextensions.py", line 711, in start
    self.install_extensions()
  File "test/lib/python3.7/site-packages/notebook/nbextensions.py", line 690, in install_extensions
    **kwargs
  File "test/lib/python3.7/site-packages/notebook/nbextensions.py", line 220, in install_nbextension_python
    destination=dest, logger=logger
  File "test/lib/python3.7/site-packages/notebook/nbextensions.py", line 187, in install_nbextension
    os.makedirs(dest_dir)
  File "test/bin/../lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'user/Library/Jupyter/nbextensions/viewer/'

In a Mac OSX virtualenv for python 3

tongshuangwu commented 4 years ago

Hi there! To install in virtualenv, please use the following two commands:

pip install checklist
jupyter nbextension install --py --sys-prefix checklist.viewer
jupyter nbextension enable --py --sys-prefix checklist.viewer

In a nutshell, as noted here:

--user to install into the user’s home jupyter directories --sys-prefix to install into python’s sys.prefix, useful for instance in virtual environments, such as with conda

Thanks for catching this, I will also make a note in the readme.

krishnadurai commented 4 years ago

@tongshuangwu thanks for this resolution!