Issue
I am currently using Jupyter
notebook and I would like to force it to print out Python
logs to the output cell.
I am using old notebook that used to work this way, probably in older version of Jupyter
notebook.
I have logging set as:
import logging
logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.INFO)
logging.root.level = 20
But when I then call:
logging.info("hello world")
It does not print anything in the output cell. It just prints out the stuff in the console in which I started the Jupyter
notebook.
I am using python 2.7.10
and installed packages in my virtual environment are:
appnope==0.1.0
backports-abc==0.4
backports.ssl-match-hostname==3.5.0.1
certifi==2016.2.28
decorator==4.0.9
functools32==3.2.3.post2
gnureadline==6.3.3
ipykernel==4.3.1
ipython==4.1.2
ipython-genutils==0.1.0
ipywidgets==4.1.1
Jinja2==2.8
jsonschema==2.5.1
jupyter==1.0.0
jupyter-client==4.2.2
jupyter-console==4.1.1
jupyter-core==4.1.0
MarkupSafe==0.23
mistune==0.7.2
nbconvert==4.1.0
nbformat==4.0.1
notebook==4.1.0
path.py==8.1.2
pexpect==4.0.1
pickleshare==0.6
ptyprocess==0.5.1
Pygments==2.1.3
pyzmq==15.2.0
qtconsole==4.2.0
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.10.0
terminado==0.6
tornado==4.3
traitlets==4.1.0
wheel==0.24.0
Was logging printout in the cell changed? Is there some way how I can force Jupyter
to write out logging to the output cell?
Solution
I have found one my old python 2.7.10
virtualenv where jupyter
works as desired.
appnope==0.1.0
backports.ssl-match-hostname==3.4.0.2
boto==2.38.0
bz2file==0.98
certifi==2015.9.6.2
decorator==4.0.4
functools32==3.2.3.post2
gensim==0.12.2
gnureadline==6.3.3
httpretty==0.8.6
ipykernel==4.1.1
ipython==4.0.0
ipython-genutils==0.1.0
ipywidgets==4.1.1
Jinja2==2.8
jsonschema==2.5.1
jupyter==1.0.0
jupyter-client==4.1.1
jupyter-console==4.0.3
jupyter-core==4.0.6
MarkupSafe==0.23
mistune==0.7.1
nbconvert==4.1.0
nbformat==4.0.1
notebook==4.0.6
numpy==1.10.1
path.py==8.1.2
Pattern==2.6
pexpect==4.0.1
pickleshare==0.5
ptyprocess==0.5
Pygments==2.0.2
pyzmq==14.7.0
qtconsole==4.1.0
requests==2.8.1
scipy==0.16.0
simplegeneric==0.8.1
six==1.10.0
smart-open==1.3.0
terminado==0.5
tornado==4.2.1
traitlets==4.0.0
wheel==0.24.0
Some packages are not related with the jupyter
problem here, problem will probably be in versions of some relevant packages. I'll try further investigate exactly where.
EDIT:
At the end I have found that the problem is in the package: ipykernel==4.3.1
or since ipykernel==4.3.0
everything works fine with ipykernel==4.1.1
or ipykernel==4.2.2
.
Issue was reported at github to the jupyter and ipykernel: https://github.com/ipython/ipykernel/issues/111
Answered By - ziky90
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.