Skip to content
This repository has been archived by the owner on May 3, 2020. It is now read-only.

OSError: Jupyter Require found itself running outside of Jupyter. #19

Open
gbonazzoli opened this issue Jan 2, 2020 · 4 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@gbonazzoli
Copy link

Following the guide at: https://medium.com/@marekermk/take-a-better-look-at-the-pandas-dataframes-a8d6613a46a

After the command:

jupyter nbextension install --py jupyter_require

I get always the following error:

Jupyter Require found itself running outside of Jupyter.
Traceback (most recent call last):
  File "/usr/local/bin/jupyter-nbextension", line 10, in <module>
    sys.exit(main())
  File "/Library/Python/3.7/site-packages/jupyter_core/application.py", line 268, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/Library/Python/3.7/site-packages/traitlets/config/application.py", line 664, in launch_instance
    app.start()
  File "/Library/Python/3.7/site-packages/notebook/nbextensions.py", line 983, in start
    super(NBExtensionApp, self).start()
  File "/Library/Python/3.7/site-packages/jupyter_core/application.py", line 257, in start
    self.subapp.start()
  File "/Library/Python/3.7/site-packages/notebook/nbextensions.py", line 711, in start
    self.install_extensions()
  File "/Library/Python/3.7/site-packages/notebook/nbextensions.py", line 690, in install_extensions
    **kwargs
  File "/Library/Python/3.7/site-packages/notebook/nbextensions.py", line 206, in install_nbextension_python
    m, nbexts = _get_nbextension_metadata(module)
  File "/Library/Python/3.7/site-packages/notebook/nbextensions.py", line 1117, in _get_nbextension_metadata
    m = import_item(module)
  File "/Library/Python/3.7/site-packages/traitlets/utils/importstring.py", line 42, in import_item
    return __import__(parts[0])
  File "/Library/Python/3.7/site-packages/jupyter_require/__init__.py", line 34, in <module>
    from .notebook import link_css
  File "/Library/Python/3.7/site-packages/jupyter_require/notebook.py", line 30, in <module>
    from .core import execute_with_requirements
  File "/Library/Python/3.7/site-packages/jupyter_require/core.py", line 279, in <module>
    require = RequireJS()
  File "/Library/Python/3.7/site-packages/jupyter_require/core.py", line 90, in __new__
    raise EnvironmentError(msg)
OSError: Jupyter Require found itself running outside of Jupyter.

Any ideas to solve the issue ?

@gbonazzoli gbonazzoli added the bug Something isn't working label Jan 2, 2020
@CermakM
Copy link
Owner

CermakM commented Jan 2, 2020

Hello and thank you for reporting it.

Are you running it in a Jupyter Notebook or Jupyter Lab? The extension is only compatible with Jupyter Notebooks.

Cheers,
M

@gbonazzoli
Copy link
Author

gbonazzoli commented Jan 2, 2020 via email

@deeplook
Copy link

deeplook commented Jan 2, 2020

I'm running into the same error. It would be nice to state in the docs that this works only for Jupyter classic notebooks, but not in Jupyter Lab, especially as Lab is increasingly superseeding classic notebook usage.

But, in fact, I've tried it now without lab, and get this when running execute_with_requirements(script, required=['d3']):

errback@http://localhost:8888/nbextensions/jupyter-require/core.js?v=20200102160426:190:29

I'm on macOS Mojave and Python 3.7 running a recent Jupyter...

@CermakM
Copy link
Owner

CermakM commented Jan 16, 2020

@gbonazzoli and @deeplook Thanks for the feedback! The README does say it's an nbextension, Jupyter Lab uses labextensions, which are different and also I always explicitly say jupyter notebook in the README. As Notebook and Lab have completely different frontend, the nbextensions do not work for both in most cases, unfortunately 😟

If the error occurs in a notebook, please provide further information, like code samples, both Python and JS console logs and we can try to figure out what's wrong together.

Cheers,
M

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants