Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import ipywidgets from notebook #41

Closed
jdoepfert opened this issue Jan 31, 2020 · 6 comments
Closed

Cannot import ipywidgets from notebook #41

jdoepfert opened this issue Jan 31, 2020 · 6 comments

Comments

@jdoepfert
Copy link

Thanks for the awesome work on the notebook integration!
I previously used it to directly jump to certain locations via a dropdown via ipywidgets. Unfortunately, v0.32.0 does not seem to support that anymore:

image

Any chance to get that back in? It would in general be awesome if I could import all my pip-installed python libraries.

@pauldmccarthy
Copy link
Owner

Could you explain to me your setup? i.e. are you using a standalone version of FSLeyes, or have you installed it into a pip/conda environment?

And did you open a notebook from within FSLeyes, or did you start FSLeyes from within an existing notebook? (both are possible :) )

@jdoepfert
Copy link
Author

Sure. I am using the standalone on MacOS.
I started the notebook like so fsleyes -S --notebookFile MyNotebook.ipynb.

@pauldmccarthy
Copy link
Owner

Right ... well I'm not entirely sure why ipywidgets was available in older versions - FSLeyes is not at all dependent on it, so it must have been a requirement of one of the direct FSLeyes dependencies, and this requirement must have changed across different FSLeyes versions.

Can I suggest that you install FSLeyes into your environment via pip, rather than using a standalone version? In this way, the FSLeyes notebook environment will have access to the python environment that you installed it into. It should be quite straightforward to install FSLeyes via pip, if you are comfortable working with virtualenvs. Alternately, you can install FSLeyes into a conda environment.

It would be really hacky to accomplish this with a standalone FSLeyes, as the standalone builds use their own python interpreter, so don't directly have access to any libraries installed in any external python environment.

@jdoepfert
Copy link
Author

jdoepfert commented Feb 2, 2020

Got it. I tried installing to conda (sudo conda install -c conda-forge fsleyes), but I got this error:
image

 $ fsleyes -S --notebookFile FSLeyes_notebook.ipynb
Exception in thread Thread-7:
Traceback (most recent call last):
  File "/usr/local/anaconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/anaconda3/lib/python3.7/site-packages/ipykernel/heartbeat.py", line 91, in run
    self._bind_socket()
  File "/usr/local/anaconda3/lib/python3.7/site-packages/ipykernel/heartbeat.py", line 74, in _bind_socket
    self._try_bind_socket()
  File "/usr/local/anaconda3/lib/python3.7/site-packages/ipykernel/heartbeat.py", line 61, in _try_bind_socket
    return self.socket.bind('%s://%s' % (self.transport, self.ip) + c + str(self.port))
  File "zmq/backend/cython/socket.pyx", line 550, in zmq.backend.cython.socket.Socket.bind
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
zmq.error.ZMQError: Address already in use

   ERROR            status.py  161: reportIfError   - Error initialising IPython/Jupyter: An error occurred initialising IPython/Jupyter!

Looks like some ZeroMQ address is already in use? Which one could that be?

I have

$ conda --version
anconda 4.8.2
$ anaconda --version
anaconda Command line client (version 1.7.2)

Will try pip install next.

@pauldmccarthy
Copy link
Owner

What version of ipykernel do you have? This may be due to a bug which was fixed late last year.

@jdoepfert
Copy link
Author

OK that seems to have fixed it!! thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants