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

not able to figure out why bqplot stops working, and how to make it work again quickly #46

Closed
stonebig opened this issue Oct 20, 2015 · 32 comments

Comments

@stonebig
Copy link

hi,

After having removed bqplot, it seems it doesn't want to plot anymore, Ipython stalls and nothing happens.

I don't see any error message, kernerl doesn't want to interrupt itself (remains in non-empty circle mode). Have you a wild guess ? (using current trunk in this try)

bqplot_blocking

!pip list

adodbapi (2.6.0.7)
alabaster (0.7.6)
astroid (1.3.6)
Babel (2.1.1)
backports-abc (0.4)
backports.ssl-match-hostname (3.4.0.2)
baresql (0.7.2)
bcolz (0.11.4)
beautifulsoup4 (4.4.1)
blaze (0.8.3)
blosc (1.2.8)
bloscpack (0.9.0)
bokeh (0.10.0)
Bottleneck (1.0.0)
bqplot (0.3.10.dev0)
brewer2mpl (1.4.1)
castra (0.1.6)
certifi (2015.9.6.1)
cffi (1.2.1)
click (5.0)
colorama (0.3.3)
configparser (3.5.0b2)
cvxopt (1.1.7)
cx-Freeze (4.3.4)
cycler (0.9.0)
cyordereddict (0.2.2)
Cython (0.23.4)
cytoolz (0.7.3)
dask (0.7.3)
datashape (0.4.7)
db.py (0.4.4)
decorator (4.0.4)
dill (0.2.4)
docopt (0.6.2)
docutils (0.12)
enum34 (1.0.4)
Flask (0.10.1)
formlayout (1.0.15)
funcsigs (0.4)
functools32 (3.2.3.post2)
greenlet (0.4.9)
guidata (1.7.0b5)
guiqwt (3.0.0b6)
h5py (2.5.0)
holoviews (1.3.2)
husl (4.0.3)
ipykernel (4.1.1)
ipyparallel (4.0.2)
ipython (4.0.0)
ipython-genutils (0.1.0)
ipython-sql (0.3.7.1)
ipywidgets (4.1.0)
itsdangerous (0.24)
jedi (0.8.1)
Jinja2 (2.8)
joblib (0.9.2)
jsonschema (2.5.1)
julia (0.1.1.8)
jupyter (1.0.0)
jupyter-client (4.1.1)
jupyter-console (4.0.3)
jupyter-core (4.0.6)
Keras (0.2.0)
llvmlite (0.6.0)
lmfit (0.9.1)
locket (0.2.0)
logilab-common (1.1.0)
lxml (3.4.4)
Markdown (2.6.2)
MarkupSafe (0.23)
matplotlib (1.5.0rc2)
mingwpy (0.1.0b3)
mistune (0.7.1)
mpld3 (0.2)
multipledispatch (0.4.8)
mysql-connector-python (2.0.4)
nbconvert (4.0.0)
nbformat (4.0.1)
netCDF4 (1.2.1)
networkx (1.10)
nltk (3.0.5)
nose (1.3.7)
notebook (4.0.6)
numba (0.20.0)
numexpr (2.4.4)
numpy (1.9.3)
numpydoc (0.5)
oct2py (3.3.3)
odo (0.3.4)
pandas (0.17.0)
pandas-datareader (0.2.0)
param (1.3.2)
partd (0.3.2)
path.py (8.1.2)
patsy (0.4.0)
pep8 (1.6.2)
pg8000 (1.10.2)
pickleshare (0.5)
Pillow (3.0.0)
pip (7.1.2)
pkginfo (1.2.1)
prettytable (0.7.2)
psutil (3.2.2)
PuLP (1.5.9)
py (1.4.30)
PyAudio (0.2.8)
pybars3 (0.9.1)
pycparser (2.14)
pyflakes (0.9.2)
Pygments (2.0.2)
pyhdf (0.8.3)
pylint (1.4.3)
PyMeta3 (0.5.1)
pymongo (3.0.3)
pyodbc (3.0.10)
PyOpenGL (3.1.0)
pyparsing (2.0.3)
PyQt4 (4.11.4)
PyQtdesignerplugins (1.1)
pyqtgraph (0.9.10)
PyQwt (5.2.1)
pyserial (2.7)
pystache (0.5.4)
pytest (2.8.2)
python-dateutil (2.4.2)
PythonQwt (0.3.0)
pytz (2015.6)
pywin32 (219)
PyYAML (3.11)
pyzmq (14.7.0)
qtconsole (4.1.0)
redis (2.10.3)
reportlab (3.2.0)
requests (2.8.1)
requests-toolbelt (0.4.0)
rope (0.10.2)
rpy2 (2.7.2)
Rx (1.2.3)
scikit-image (0.11.3)
scikit-learn (0.16.1)
scilab2py (0.6)
scipy (0.16.0)
seaborn (0.7.0.dev0)
setuptools (18.4)
simplegeneric (0.8.1)
simplejson (3.8.0)
singledispatch (3.4.0.3)
six (1.10.0)
snowballstemmer (1.2.0)
Sphinx (1.3.1)
sphinx-rtd-theme (0.1.9)
spyder (3.0.0.dev0)
SQLAlchemy (1.0.8)
sqlite-bro (0.8.10)
sqlparse (0.1.16)
statsmodels (0.6.1)
sympy (0.7.6.1)
tables (3.2.2)
Theano (0.7.0)
toolz (0.7.4)
tornado (4.2.1)
traitlets (4.0.0)
twine (1.6.3)
twitter (1.17.1)
ViTables (2.1)
Werkzeug (0.10.4)
wheel (0.26.0)
winpython (1.2)
xlrd (0.9.4)
XlsxWriter (0.7.6)
xray (0.6.0)
@SylvainCorlay
Copy link
Member

@stonebig thanks for reporting. Can you please hit "Crtl+Shift+J" in your browser window if you are on Linux or Windows, and "Cmd+Alt+J" if you are on mac and tell me about the JavaScript console errors?

My bet is that you would be missing the d3.js and topojson javascript dependencies.

If you are running from source, please note that you need to run "bower install" in the bqplot top directory.

@stonebig
Copy link
Author

<Ctrl><Shift>J on Chrome (same on Firefox):

Starting WebSockets: ws://localhost:8888/api/kernels/58e15ded-ac42-4413-a82f-8ad86c0c3b76
main.min.js:22160 Kernel: kernel_connected (58e15ded-ac42-4413-a82f-8ad86c0c3b76)
main.min.js:22160 Kernel: kernel_ready (58e15ded-ac42-4413-a82f-8ad86c0c3b76)
main.min.js:12030 Loaded extension: widgets/notebook/js/extension
:8888/nbextensions/widgets/notebook/js/extension.js?v=20151020174858:81 loaded widgets
kernel.js:98 Kernel: kernel_restarting (58e15ded-ac42-4413-a82f-8ad86c0c3b76)
kernel.js:98 Kernel: kernel_created (58e15ded-ac42-4413-a82f-8ad86c0c3b76)
kernel.js:440 Starting WebSockets: ws://localhost:8888/api/kernels/58e15ded-ac42-4413-a82f-8ad86c0c3b76
kernel.js:98 Kernel: kernel_connected (58e15ded-ac42-4413-a82f-8ad86c0c3b76)
kernel.js:98 Kernel: kernel_ready (58e15ded-ac42-4413-a82f-8ad86c0c3b76)
require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:1926 GET http://localhost:8888/nbextensions/bqplot/components/d3/d3.js?v=20151020174858 404 (Not Found)req.load @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:1926context.load @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:1667Module.load @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:829Module.fetch @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:819Module.check @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:851Module.enable @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:1165context.enable @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:1538(anonymous function) @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:1150(anonymous function) @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:131each @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:56Module.enable @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:1102Module.init @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:783callGetModule @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:1192context.completeLoad @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:1571context.onScriptLoad @ require.js?v=2de44fdcc1fe5e939aa4ce80626b241d:1699
utils.js:777 WrappedError {stack: "Error: Couldn't create a model.↵    at new Error (…in.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33", message: "Couldn't create a model.", error_stack: Array[3]}(anonymous function) @ utils.js:777
kernel.js:865 Couldn't process kernel message WrappedError {stack: "Error: Couldn't create a model.↵    at new Error (…in.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33", message: "Couldn't create a model.", error_stack: Array[3]}(anonymous function) @ kernel.js:865
utils.js:777 WrappedError {stack: "Error: Couldn't create a model.↵    at new Error (…in.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33", message: "Couldn't create a model.", error_stack: Array[3]}(anonymous function) @ utils.js:777
kernel.js:865 Couldn't process kernel message WrappedError {stack: "Error: Couldn't create a model.↵    at new Error (…in.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33", message: "Couldn't create a model.", error_stack: Array[3]}(anonymous function) @ kernel.js:865
utils.js:777 WrappedError {stack: "Error: Couldn't create a model.↵    at new Error (…in.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33", message: "Couldn't create a model.", error_stack: Array[3]}(anonymous function) @ utils.js:777
kernel.js:865 Couldn't process kernel message WrappedError {stack: "Error: Couldn't create a model.↵    at new Error (…in.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33", message: "Couldn't create a model.", error_stack: Array[3]}(anonymous function) @ kernel.js:865
utils.js:777 WrappedError {stack: "Error: Couldn't create a model.↵    at new Error (…in.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33", message: "Couldn't create a model.", error_stack: Array[3]}(anonymous function) @ utils.js:777
kernel.js:865 Couldn't process kernel message WrappedError {stack: "Error: Couldn't create a model.↵    at new Error (…in.js?v=40e10638fcf65fc1c057bff31d165e9d:12785:33", message: "Couldn't create a model.", error_stack: Array[3]}(anonymous function) @ kernel.js:865

@SylvainCorlay
Copy link
Member

That is it. I think that you are running from source. You need to run bower install to run from source as explained in the readme.

@stonebig
Copy link
Author

Does it mean I must have first nodes.js and npm installed ?

@SylvainCorlay
Copy link
Member

Yes, node is required to run from source. We will actually soon drop bower and only use npm instead like in ipywidgets. (However you don't need node to install the package from pypi).

@stonebig
Copy link
Author

ok. I can get a node.exe working, and a npm also, up to the moment node-gyp will try (and fail) to compile something. nodejs/node-gyp#660

bqplot indirectly requires that you have vs201x installed (if you are on native Windows).

(very sad, as mingwpy is now available as a wheel, and msys is neither an option, unless maybe you switch to a mingw-msys-made python nodejs/node-gyp#194 (comment))

@SylvainCorlay
Copy link
Member

@ssunkara1 has been using npm on windows. He might be able to look at it.

@stonebig
Copy link
Author

maybe Windows cannot survive the nodejs shift of the Jupyter project

@stonebig
Copy link
Author

Well, it works again with tonight new release, without nodejs. that's a bit strange to me.

@SylvainCorlay
Copy link
Member

Let me know if it works with WinPython

@stonebig
Copy link
Author

I placed a bqplot example in the winpython_checker.ipynb, seems ok on all versions I do prepare at the moment.

@SylvainCorlay
Copy link
Member

Are you adding bqplot to winpython?

@stonebig
Copy link
Author

Yes.

@SylvainCorlay
Copy link
Member

🎂 🎉 🏆 🍹 !

@stonebig
Copy link
Author

something wired happens at the end-of-the-day, the bqplot doesn't want to display anything, even after reboot.
bqplot_showing_uniform_grey_image

@stonebig
Copy link
Author

if I delete the extension and I redo python -m bqplot.install --user --force the bqplot cell holds the kernel undefinitely.
bqplot_locking_kernel_forever

It looks I'm in the same situation of 5 days ago. So no clue:

  • how I broke bqplot,
  • and how it solved itself saturday morning.

@stonebig
Copy link
Author

Curious chain of actions:

  • I killed the server with Jupyter menu ==> no effect,
  • I closed the window, reclicked on the bqplot workbook ==> then I see the bqplot curve showing immediately (I didn't even launch an action), at cell 1 output (cell 1 input was the dos action of 2nd step bqplot), the cell before I actually summon bqplot graphic.

bqplot_locking_kernel_forever_and_now_is_back_cell_1_instead_of_2

@stonebig
Copy link
Author

and now if I relaunch the cell with x = np.linspace(1.0, 10.0, n), I get 2 curves:
bqplot_next02

@stonebig
Copy link
Author

so:

  • either there is some initialisation I should do because bqplot doesn't die (or live) exactly like the kernel process,
  • either there is a bug of some sort.

In any case, there should be a simple workaround (or procedure steps), as it seems I can unlock/repair without deleting/re-installing everything

@stonebig
Copy link
Author

seems that plt.figure(2) gets me a new figure.

@stonebig
Copy link
Author

maybe just a plt.clear() in the front page example https://github.com/bloomberg/bqplot ?

from bqplot import pyplot as plt
import numpy as np
plt.clear()
plt.figure(1)
np.random.seed(0)
n = 200
x = np.linspace(3.0, 10.0, n)
y = np.cumsum(np.random.randn(n))
plt.plot(x,y, axes_options={'y': {'grid_lines': 'dashed'}})
plt.show()

@stonebig
Copy link
Author

no, doesn't solve all cases:
bqplot_next03

@stonebig stonebig changed the title unable to re-install bqplot not able to figure out why bqplot stops working, and how to make it work again quickly Oct 25, 2015
@stonebig stonebig reopened this Oct 25, 2015
@SylvainCorlay
Copy link
Member

Hi @stonebig,

The behavior with 1-2 curves and the figure command is expected.

  1. If you do figure(x), where x is anything hashable, it looks for a context named x. If there is none, it creates a new blank figure for you. If there is already one, it is returned to you. It is exactly the same behavior than Matlab or Matplotlib (with interactive mode on). In your case, the context figure for the key 1 already had a line chart on it.

  2. Calling figure() with no argument creates a new blank context figure, which cannot be addressed by key later, like in Matlab.

  3. Calling figure(fig=foobar) where foobar is an instance of Figure makes the specified figure the context figure.

    We third case does not exist in Matlab, and is meant for people who use both the pyplot and the bqplot APIs.

Regarding the issues that you have when updating the JavaScript side, one advice I can give you is to clean the cache of chrome. Chrome's cache is very annoying. To do so, you need to open the developer tools (Crtl + Shift + J), then right-click on the reload button and do "Clear cache and hard reload".

@stonebig
Copy link
Author

by default I play in Firefox. trying to clear cash as 1rst rescue kit

@stonebig
Copy link
Author

I'm still with this square-grey figure showing nothing... scratching my head

@SylvainCorlay
Copy link
Member

@stonebig do you run the whole Pyplot example? There is a call to plt.clear in this notebook.

@stonebig
Copy link
Author

yes, in the mean time with your Ctrl+Shift+i then Ctrl+Shift+J , chrome showed the curve agained (but not firefox) ... and now going back to firefox it's ok.

I'm lost in how to ink an auto-recover procedure there.

Can't there be a way to poison the cache (for the bqplot graph) ? so that Chrome/firefox/edge would reload it clean ? could it be something else than the cache ?

(if it was ony a browser cache matter, there should be no border-effect between Chrome and Firefox, shouldn't it ? if I unlock one by unlocking the other, the common factor may be on the server part, as they used the same localhost:8888 session)

@SylvainCorlay
Copy link
Member

OK, there might be a firefox-specific issue here 😒 I will look into it.

@stonebig
Copy link
Author

# bqplot
# if bqplot shows en empty figure and you're on chrome, try <Ctrl>+<Shift>+I then <Ctrl>+<Shift>+J (clear the browser cache) 

from bqplot import pyplot as plt
import numpy as np
plt.close(1)
plt.clear()  # critical detail 
plt.figure(1)
np.random.seed(0)
n = 200
x = np.linspace(0.0, 10.0, n)
y = np.cumsum(np.random.randn(n))
plt.plot(x,y, axes_options={'y': {'grid_lines': 'dashed'}})
plt.show()

@stonebig
Copy link
Author

will the soon landing Ipython4.1 make a difference in stability / flawless configurations for bqplot ?

@SylvainCorlay
Copy link
Member

The two-step installation procedure is likely to remain until notebook 5.0 is released unless we find a temporary solution in the meantime. With 5.0, extensibility of the front-end is really being reworked and packaging of nbextensions is part it.

Other IPython widget libraries like pythreejs have exactly the same problem as bqplot and the installation procedure is exactly the same.

However, ipyywidgets 4.2 is probably going to bring changes. Especially with PR jupyter-widgets/ipywidgets#193 which should enable the use of IPython widgets (including bqplot) in other web applications than the notebook.

@SylvainCorlay
Copy link
Member

@stonebig closing this one. There is another issue open for the firefox-specific problem

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