googlecolab / jupyter_http_over_ws

Apache License 2.0
267 stars 56 forks source link

Error while enabling jupyter_http_over_ws extension #11

Open Kshitij09 opened 4 years ago

Kshitij09 commented 4 years ago

I'm following the instructions described here.

The very second step to enable jupyter_http_over_ws jupyter extension gives following error:

Traceback (most recent call last):
  File "/usr/local/bin/jupyter-serverextension", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/local/lib/python2.7/dist-packages/notebook/serverextensions.py", line 293, in start
    super(ServerExtensionApp, self).start()
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 256, in start
    self.subapp.start()
  File "/usr/local/lib/python2.7/dist-packages/notebook/serverextensions.py", line 210, in start
    self.toggle_server_extension_python(arg)
  File "/usr/local/lib/python2.7/dist-packages/notebook/serverextensions.py", line 199, in toggle_server_extension_python
    m, server_exts = _get_server_extension_metadata(package)
  File "/usr/local/lib/python2.7/dist-packages/notebook/serverextensions.py", line 327, in _get_server_extension_metadata
    m = import_item(module)
  File "/usr/local/lib/python2.7/dist-packages/traitlets/utils/importstring.py", line 42, in import_item
    return __import__(parts[0])
ImportError: No module named jupyter_http_over_ws

Tried installing tornado==5.1 as mentioned in #5

Also tried upgrading the package: pip install --upgrade jupyter_http_over_ws

dronenb commented 4 years ago

How did you install jupyter? Via homebrew? I was having the same issue until I uninstalled all local copies of jupyter installed via pip and pip3, then I followed the instructions here and install the latest version of python via pyenv, then installed jupyter via homebrew. I then did 'pip3 install jupyter_http_over_ws' and the command to enable the extension worked fine.

Kshitij09 commented 4 years ago

I was working on colab so it was preinstalled

fvapolina commented 4 years ago

I uninstalled global (not in venv) jupyter notebook and it worked

ethanm88 commented 4 years ago

@Kshitij09 I am facing the same issue with Google Colab.

Dinkarkumar commented 4 years ago

make sure if your whole working environment is installed with pip then use pip otherwise use pip3. for example, my whole environment of anaconda , python library, jupyter notebook was installed with pip but i was enabling the second command as you mentioned in question with pip3. I got the same error as you but when i tried installing with pip and enabled using pip , it worked. Screenshot from 2020-08-04 00-54-00 It showed the following error after executing second command. Screenshot from 2020-08-04 00-53-46 Then again installed the library using pip as the following. Screenshot from 2020-08-04 00-54-14 And finally it worked. Screenshot from 2020-08-04 00-53-26 Hope it helps.

nicoelbert commented 3 years ago

If you installed your enviroment with conda, try to install the jupyter_http_over_ws package also via conda:

conda install -c conda-forge jupyter_http_over_ws

Then you should be able to enable the serverextension using:

jupyter serverextension enable --py jupyter_http_over_ws

After that run the following code also in PowerShell and you'll receive the url with the tokencode for Colab in there:

jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' \ --port=9090 --no-browser
mukteshkrmishra commented 3 years ago

Thanks @nicoelbert , worked for me.

ajay-aditatechnologies commented 3 years ago

make sure if your whole working environment is installed with pip then use pip otherwise use pip3. for example, my whole environment of anaconda , python library, jupyter notebook was installed with pip but i was enabling the second command as you mentioned in question with pip3. I got the same error as you but when i tried installing with pip and enabled using pip , it worked. Screenshot from 2020-08-04 00-54-00 It showed the following error after executing second command. Screenshot from 2020-08-04 00-53-46 Then again installed the library using pip as the following. Screenshot from 2020-08-04 00-54-14 And finally it worked. Screenshot from 2020-08-04 00-53-26 Hope it helps.

Can you please it does work with Ubuntu 20 version

deKeijzer commented 3 years ago

If you installed your enviroment with conda, try to install the jupyter_http_over_ws package also via conda:

conda install -c conda-forge jupyter_http_over_ws

Then you should be able to enable the serverextension using:

jupyter serverextension enable --py jupyter_http_over_ws

After that run the following code also in PowerShell and you'll receive the url with the tokencode for Colab in there:

jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' \ --port=9090 --no-browser

This is still working, thanks!

RobRomijnders commented 2 years ago

+1 to reply by @dronenb . Installing jupyter notebook in a new virtualenv worked for me (i.e. such that the system jupyter is not used).

gift-exe commented 1 year ago

I've tried installing jupyter_http_over_ws_extension with pip, pip3, and conda. It installs successfully but when I try to enable it I get this error.

Screenshot from 2023-01-16 10-48-29

"jupyter serverextension enable --py jupyter_http_over_ws", is what I'm trying to use to enable the library

I read the markupsafe/init.py file and did not see a function or method named "soft_unicode".

I'd appreciate it if you tell me what to do to fix this error.

RobRomijnders commented 1 year ago

For me, the issue was fixed after re-install. Did you try that?

Also, your prompt starts with (base) $. Are you sure you did the installs in the (base) environment? I would recommend to make a separate environment to avoid confusion of versions.