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

jupyter notebook run error #5

Open
surfaceowl opened this issue Jan 14, 2018 · 5 comments
Open

jupyter notebook run error #5

surfaceowl opened this issue Jan 14, 2018 · 5 comments

Comments

@surfaceowl
Copy link
Contributor

@noahgift -- great contribution! This is definitely handy. I encountered one minor issue when running the jupyter notebook. Immediately after cloning the repo, the 'execution count' is not set - and when a user tries to run the notebook they get a popup window with this message:

Notebook validation failed: 'execution_count' is a required property:
{
 "data": {
  "text/html": "<style>.container { width:100% !important; }</style>",
  "text/plain": "<IPython.core.display.HTML object>"
 },
 "metadata": {},
 "output_type": "execute_result"
}

For users who just want to test this quickly - the manual fix is to open the /notebooks/spot_pricing_ml.ipynb file in pycharm, manually set each cell to Markdown, then in jupyter notebook select Restart & Run All from the Kernel menu. Once that is done, still inside the juptyer notebook, the user changes each cell from Markdown to Code, and repeats the Restart & Run All command - everything works great.

I don't have write access to this repo, but in pycharm I was able to change the cell metadata "execution_count": null, to "execution_count": 1, in the Find All window. Opening the file directly in PyCharm just displayed the code in the cells, not the cell metadata which is what should be changed.

@surfaceowl
Copy link
Contributor Author

There are only three lines in the metadata of /notebooks/spot_pricing_ml.ipynb need to be updated: 1739, 1748 and 1757.

spot exec_count_null

After a fresh install of the repo and changing these three values from null to 1, the notebook launches correctly.

image

@Toyosie
Copy link

Toyosie commented Jan 2, 2020

i'm a beginner to jupyter notebooks and data science, numpy...
i tried this on my jupyter notebook:

"""import numpy as np
a= np.array([1,2,3,4])
print(a)"""

and it showed me this error:

NameError Traceback (most recent call last)
in
----> 1 import numpy as np
2 a= np.array([1,2,3,4])
3 print(a)

~\numpy.py in
32 {
33 "cell_type": "code",
---> 34 "execution_count": null,
35 "metadata": {},
36 "outputs": [],

NameError: name 'null' is not defined

please help
thank you.

@surfaceowl
Copy link
Contributor Author

is this related to one of the notebooks in this repo? If not, try searching on Stack Overflow. You could quickly try editing the notebook metadata from within jupyter:

image



...or editing the metadata of the cell to fix:
image

...if that does not fix the problem, you could open the notebook in an editor like PyCharm or VSCode, and make the edits there (see previous comments in this thread).

@Toyosie
Copy link

Toyosie commented Jan 9, 2020

trying to edit the metedata doesn't work either

@Toyosie
Copy link

Toyosie commented Jan 9, 2020

Capture

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