Jupyter notebook kernel keeps restarting the moment I open a notebook - jupyter-notebook

The server starts but the moment I open a notebook, even a blank one, the kernel die and keeps restarting. I'm using python3.7 in arch-linux.
The error "RuntimeError: This event loop is already running" keeps happening in loop.
Connecting to: tcp://127.0.0.1:36789
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.7/site-packages/ipykernel_launcher.py", line 16, in <module>
app.launch_new_instance()
File "/usr/lib/python3.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/usr/lib/python3.7/site-packages/ipykernel/kernelapp.py", line 477, in start
ioloop.IOLoop.instance().start()
File "/usr/lib/python3.7/site-packages/tornado/platform/asyncio.py", line 132, in start
self.asyncio_loop.run_forever()
File "/usr/lib/python3.7/asyncio/base_events.py", line 510, in run_forever
raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running

This is probably an Arch Linux issue, that has been asked on their forums multiple times, e.g. here, and a bug report has been created. It should be solved once python-ipykernel is upgraded, but I have no idea how long that'll take.
UPDATE: it has been updated in the repo, so upgrading your system will fix it.
A temporary hacky solution that worked for me is to upgrade it using pip as a user (so it gets installed in ~/.local instead of /usr/), i.e.:
pip install --user --upgrade ipykernel
This way, you don't have to downgrade any packages (which might be a better solution but more annoying to do).
When the Arch team has upgraded the package it is probably a good idea to remove the pip-version (pip uninstall ipykernel)

Related

jupyter notebook list error after drive ran out of room

another user on my ubuntu server was trying to install anaconda in their home directory. they downloaded anaconda to their home directory and installed it, and it took up all remaining room for users on the server. So my user who is a different user, in a different home directory could no longer run jupyter notebook and I got a dead kernel error. After moving their copy of anaconda from the their home directory to a different drive with more room, I am now able to again launch and run jupyter notebooks with my user, but I'm now getting the error below when I try to check for running notebook servers and get the token. Does anyone know what the issue might be and can you suggest how to fix? Again this was another user installing anaconda in their home directory. I'm confused why that would effect my user with a completely different home directory, except that we ran out of room on the drive momentarily.
code:
jupyter notebook list
error:
Traceback (most recent call last):
File "/home/user/anaconda3/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/home/user/anaconda3/lib/python3.7/site-packages/jupyter_core/application.py", line 254, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/user/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 845, in launch_instance
app.start()
File "/home/user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 2288, in start
super().start()
File "/home/user/anaconda3/lib/python3.7/site-packages/jupyter_core/application.py", line 243, in start
self.subapp.start()
File "/home/user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 596, in start
serverinfo_list = list(list_running_servers(self.runtime_dir))
File "/home/user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 2388, in list_running_servers
info = json.load(f)
File "/home/user/anaconda3/lib/python3.7/json/__init__.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/home/user/anaconda3/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/home/user/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/user/anaconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I was able to solve the issue by going to the directory
/home/user/.local/share/jupyter/runtime
and deleting files with names like
nbserver-xxxx.json
that were empty. After that jupyter notebook list worked fine.

Eucalyptus 4.4.4 Eucaconsole 502 Bad Gateway / WebOb Version Conflict

I've completed a manual installation of Eucalpytus 4.4.4 but when I try to use a web browser to reach the eucaconsole (running on the same host as CLC/UFS) I get a 502 Bad Gateway Error.
I'm focusing on this error in the eucaconsole.log What does it mean and how can I update WebOb?
pkg_resources.VersionConflict: (WebOb 1.2.3 (/usr/lib/python2.7/site-packages), Requirement.parse('WebOb>=1.3.1'))
Eucaconsole_startup.log:
Traceback (most recent call last):
File "/bin/eucaconsole", line 106, in <module>
daemonize(start_console)
File "/bin/eucaconsole", line 61, in daemonize
func()
File "/bin/eucaconsole", line 73, in start_console
load_entry_point('pyramid', 'console_scripts', 'pserve')(args)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2259, in load
if require: self.require(env, installer)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2272, in require
working_set.resolve(self.dist.requires(self.extras),env,installer)))
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 630, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (WebOb 1.2.3 (/usr/lib/python2.7/site-packages), Requirement.parse('WebOb>=1.3.1'))
I've edited this post to remove info and focus on the clear WebOb version error.
This issue was solved below. Adding a note that the downlevel python-webob version is actually a requirement of the midonet client installation. So if you expect to run VPCMIDO and have the midonet gateway on your CLC you'll have to run your eucaconsole elsewhere.
This was resolved by removing an older python-webob package to ensure that the newer python-webob1.4 package from epel was used.
Related issue in github:
https://github.com/Corymbia/eucalyptus/issues/124
Selinux problem. Run the following in the your CLC/UFS machine
setsebool -P httpd_can_network_connect 1
Its better to flush your iptables during installation.

Error in install_keras() in R since Ubuntu update

I used the book "Deep Learning with R" since one month now, and it enables me to make my first neural networks.
I am using Ubuntu. Until 2 days ago, everything was OK and worked fine. But two days ago I updated my Ubuntu to Ubuntu 18.02. Since then, my R code is not working anymore.
I have re-done what is recommended in the book (and what has worked one month ago):
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install python-pip python-dev
$ sudo apt-get install build-essential cmake git unzip pkg-config libopenblas-dev liblapack-dev
I had no error.
then in R:
install.packages("keras")
library(keras)
install_keras()
This last command is supposed to install the core Keras library along with its dependencies in a Python virtual environment using TensorFlow.
But I obtained the following error that I really do not understand:
> install_keras()
Using existing virtualenv at ~/.virtualenvs/r-tensorflow
Upgrading pip ...
Traceback (most recent call last):
File "/home/baragatt/.virtualenvs/r-tensorflow/bin/pip", line 7, in <module>
from pip._internal import main
File "/home/baragatt/.virtualenvs/r-tensorflow/local/lib/python2.7/site-packages/pip/_internal/__init__.py", line 5, in <module>
import logging
File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
import sys, os, time, cStringIO, traceback, warnings, weakref, collections
File "/usr/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Erreur : Error 1 occurred installing TensorFlow
I have re-installed R, python, tensorflow, but I always have the same error. I do not understand this error. Maybe this is a problem with the virtualenv?
Can someone help me please? It is so frustrating, because two days ago my code was running, and now impossible to work...
I am working with Ubuntu 18.02, at the installed versions are python 2.7.15~rc1-1, R-3.4.4 and tensorflow-1.10.0.
Thanks a lot for this post. I do not really understand what the commands in this post are supposed to fix. But I have done the following:
cd /home/baragatt/.virtualenvs/r-tensorflow/
Then, as proposed in the post:
virtualenv . --system-site-packages
I obtained the following messages:
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/baragatt/.virtualenvs/r-tensorflow/bin/python2
Not overwriting existing python script /home/baragatt/.virtualenvs/r-tensorflow/bin/python (you must use /home/baragatt/.virtualenvs/r-tensorflow/bin/python2)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv.py", line 2375, in <module>
main()
File "/usr/lib/python3/dist-packages/virtualenv.py", line 724, in main
symlink=options.symlink)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 946, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/lib/python3/dist-packages/virtualenv.py", line 1417, in install_python
os.symlink(py_executable_base, full_pth)
OSError: [Errno 17] File exists
I also tried:
virtualenv -p /usr/bin/python2.7 .
And I obtained:
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /home/baragatt/.virtualenvs/r-tensorflow/bin/python2.7
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv.py", line 2375, in <module>
main()
File "/usr/lib/python3/dist-packages/virtualenv.py", line 724, in main
symlink=options.symlink)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 946, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/lib/python3/dist-packages/virtualenv.py", line 1278, in install_python
shutil.copyfile(executable, py_executable)
File "/usr/lib/python2.7/shutil.py", line 97, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 40] Too many levels of symbolic links: '/home/baragatt/.virtualenvs/r-tensorflow/bin/python2.7'
I finally find a solution, by looking at different forums.
I thought that the problem should be because of the virtualenvironment that should be created when doing the following command in R.
install_keras()
Hence, I deleted the virtual environment(s) by deleting the directory in which these environements are located (I imagine).
cd ~/.virtualenvs
rm -r r-tensorflow/
Then I have tried the following commands in R
install.packages("keras")
library(keras)
install_keras()
And it works! Honestly, I still do not understand what was the problem that occured after my Ubuntu update.

iprof and iprof_totals profiling error

I get this error after trying :
openmdao iprof x.py
or
openmdao iprof_totals x.py
on my terminal. Any idea why it could be? Do we have a simple sample code where the iprof works smoothly.
Traceback (most recent call last):
File "/home/user/miniconda3/bin/openmdao", line 11, in
sys.exit(openmdao_cmd())
File "/home/user/miniconda3/lib/python3.6/site-packages/openmdao/utils/om.py", line 403, in openmdao_cmd
options.executor(options)
File "/home/user/miniconda3/lib/python3.6/site-packages/openmdao/devtools/iprofile.py", line 373, in _iprof_totals_exec
_iprof_py_file(options)
File "/home/user/miniconda3/lib/python3.6/site-packages/openmdao/devtools/iprofile.py", line 429, in _iprof_py_file
_finalize_profile()
File "/home/user/miniconda3/lib/python3.6/site-packages/openmdao/devtools/iprofile.py", line 183, in _finalize_profile
qfile, qclass, qname = find_qualified_name(filename, int(line), cache, full=False)
File "/home/user/miniconda3/lib/python3.6/site-packages/openmdao/devtools/iprof_utils.py", line 73, in find_qualified_name
with open(filename, 'Ur') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'packages/openmdao/jacobians/jacobian.py'
I looked into this and there is currently a bug when using 'openmdao iprof' and 'openmdao iprof_totals' on a version of OpenMDAO that was not installed from an OpenMDAO repository using 'pip install -e'. I put a story in our bug tracker to fix it.

Syntax Error running bin/buildout on Plone 3.2.3

I get the folowing error when I run bin/buildout.
I´ve check this issue here on Plone.org and they say that it ´s not dangerous
but they do not say how to resolve it.
I want to skip this error in order to execute bin/buildout withouth errors, til now I´m updating my products manually. How can I solve this?
root#sevilla2:/var/plone/zinstance# bin/buildout
While:
Installing.
Getting section precompile.
Initializing section precompile.
Loading zc.buildout recipe entry plone.recipe.precompiler:default.
An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/var/plone/buildout-cache/eggs/zc.buildout-1.1.2-py2.4.egg/zc/buildout/buildout.py", line 1509, in main
getattr(buildout, command)(args)
File "/var/plone/buildout-cache/eggs/zc.buildout-1.1.2-py2.4.egg/zc/buildout/buildout.py", line 357, in install
[self[part]['recipe'] for part in install_parts]
File "/var/plone/buildout-cache/eggs/zc.buildout-1.1.2-py2.4.egg/zc/buildout/buildout.py", line 888, in __getitem__
options._initialize()
File "/var/plone/buildout-cache/eggs/zc.buildout-1.1.2-py2.4.egg/zc/buildout/buildout.py", line 969, in _initialize
recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
File "/var/plone/buildout-cache/eggs/zc.buildout-1.1.2-py2.4.egg/zc/buildout/buildout.py", line 932, in _install_and_load
return pkg_resources.load_entry_point(
File "/var/plone/buildout-cache/eggs/setuptools-0.6c9-py2.4.egg/pkg_resources.py", line 277, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/var/plone/buildout-cache/eggs/setuptools-0.6c9-py2.4.egg/pkg_resources.py", line 2180, in load_entry_point
return ep.load()
File "/var/plone/buildout-cache/eggs/setuptools-0.6c9-py2.4.egg/pkg_resources.py", line 1913, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/var/plone/buildout-cache/eggs/plone.recipe.precompiler-0.6-py2.4.egg/plone/recipe/precompiler/__init__.py", line 7, in ?
from pythongettext.msgfmt import Msgfmt
File "/var/plone/buildout-cache/eggs/python_gettext-2.1-py2.4.egg/pythongettext/msgfmt.py", line 265
except Exception as msg:
^
SyntaxError: invalid syntax
I came from a migration of my site (successfully completed but builded without buildout)
Plone 3.2.3
CMF 2.1.2 Zope (Zope 2.10.7-final, python 2.4.5, linux2)
Python 2.4.5 [GCC 4.4.5]
PIL 1.1.6
You'll need to pin python-gettext to use a version before version 2.0. That version introduced syntax that requires Python 2.6 or newer (to make the package work on Python 3 as well).
In your buildout versions section, add:
python-gettext = 1.2

Resources