Closed psychemedia closed 3 years ago
Thanks for the report, I will look at it right away.
I understand about the * import suggestion. I have tried to explain why here: https://friendly-traceback.github.io/docs/import_all.html
@psychemedia Could you tell me which version of Jupyter notebook/lab you are using? I cannot reproduce the error here, but I am using the latest version of jupyter:
> jupyter --version
jupyter core : 4.7.1
jupyter-notebook : 6.4.0
qtconsole : not installed
ipython : 7.25.0
ipykernel : 6.0.1
jupyter client : 6.1.12
jupyter lab : 3.0.16
nbconvert : 6.1.0
ipywidgets : not installed
nbformat : 5.1.3
traitlets : 5.0.5
Looking at the traceback you included, I see that code blocks "file names" are of the form "
Version 0.4.2 uploaded to PyPI should work.
Seems to import okay with that latest version, thanks (though reports an older version?)
from friendly.jupyter import *
> friendly_traceback 0.4.0; friendly 0.4.1.
Re: import *
: I just noticed your explanation in the docs:-) I think it would be useful to add just a minimal import statement that shows how to load in just what's required to support the richer traceback messages. Eg at the moment, I'm simply interested in the richer traceback/error message part of the package, but not any of the interactive commands which is perhaps more just the friendly-traceback
components?
Thanks.
The reported version number not being updated is weird: it should be automatically extracted from the code. Here's what I see here:
However, I think I saw the old version number like you did when I ran it first. Anyway, as long as it works, it should be fine.
Regarding your other comment:
My recommendation would be to do
from friendly.jupyter import Friendly
so that, if ever you needed, you could type in Friendly.why()
, etc.
I would possibly also import the functions light
and dark
as they can provide nicer output, depending on the theme used by Jupyter.
Alternatively, if you really aren't interested in anything but the absolute minimum, the following should work.
from friendly import jupyter
I really need to document all of this ...
Thanks again for your report and comments, and for confirming that it seems to work correctly for you.
Hi, thanks... from friendly import jupyter
looks interesting.
Just in passing, not sure if you've seen this PR to IPython that adds the cell run number to error messages: https://github.com/ipython/ipython/pull/13043
I had not see that. I wonder if it was motivated by a suggestion I made: https://github.com/ipython/ipykernel/issues/716
(also https://github.com/ipython/ipython/issues/12755).
With this change, friendly-traceback loses one of its advantages! ;-) ;-)
For teaching novices, I think helpful error messages could be really useful.
Another related example I'm aware of is the pseudo text-from-code generator and narrative error reports used in BlockPy: https://blog.ouseful.info/2016/02/18/blockpy-python-blockly-environment/
Thanks for the latest link; I'm reopening this issue as a reminder to look at this in more details later.
RE: blockpy - this appears to to be the helpful bit: https://pedal-edu.github.io/pedal/
@psychemedia I have created a new issue, #5, that might be of interest to you. Feel free to add your comments.
This issue was kept open for reference to some other projects. One of these (pedal) was already linked in an old issue from the previous friendly-traceback [1]. This information properly belongs to friendly-traceback and not friendly (this project); it has now been added as an issue to friendly-traceback [2].
One of the projects mentioned is Pedal. That project had mentioned using Friendly-traceback in one of its own issues [3] which I commented upon.
With the new issue [2] created, there is no need to keep this issue open anymore, since everything has been taken care of.
[1] https://github.com/aroberge/friendly/issues/100
[2] https://github.com/friendly-traceback/friendly-traceback/issues/30
Hi
This is a really useful looking project for supporting novice coders.
I just tried installing the current version from PyPi (0.4.1) and running in a Jupyter notebook (classic and in JupyterLab) but I get an error on the initial import:
Generates the error:
In passing, I note that
from friendly.jupyter import *
is a really dodgy (and bad practice) thing to inflict onto novices. They donlt really have any idea what's in the namespace or how it works anyway, so importing who knows what via*
could create all sorts of inexplicable errors and misunderstandings for them.