Application launch error in Jupyter notebook - anaconda

I receive an Application launch error whenever I launch Jupyter notebook. I tried to follow the instructions in the last line of the error but the error never goes away. Could it be something with the working directory?
When I check the working directory in Jupyter notebook using %pwd, I get C:\Users\mayerk
However, my Anaconda working directory is C:\Users\mayerk\AppData\Local\Continuum\anaconda3
This is the error that Anaconda Navigator returns each time I launch Jupyter Notebook:
[I 09:30:37.269 NotebookApp] The port 8888 is already in use, trying another port.
[I 09:30:37.269 NotebookApp] The port 8889 is already in use, trying another port.
[I 09:30:37.270 NotebookApp] The port 8890 is already in use, trying another port.
[I 09:30:37.324 NotebookApp] JupyterLab beta preview extension loaded from C:\Users\mayerk\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab
[I 09:30:37.324 NotebookApp] JupyterLab application directory is C:\Users\mayerk\AppData\Local\Continuum\anaconda3\share\jupyter\lab
[W 09:30:37.334 NotebookApp] Error loading server extension jupyterlab
Traceback (most recent call last):
File "C:\Users\mayerk\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\commands.py", line 321, in __init__
self._run(['node', 'node-version-check.js'], cwd=HERE, quiet=True)
File "C:\Users\mayerk\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\commands.py", line 1165, in _run
proc = Process(cmd, **kwargs)
File "C:\Users\mayerk\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\process.py", line 73, in __init__
self.proc = self._create_process(cwd=cwd, env=env)
File "C:\Users\mayerk\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\process.py", line 131, in _create_process
cmd[0] = which(cmd[0], kwargs.get('env'))
File "C:\Users\mayerk\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\jlpmapp.py", line 59, in which
raise ValueError(msg)
ValueError: Please install nodejs 5+ and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\mayerk\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\notebookapp.py", line 1454, in init_server_extensions
func(self)
File "C:\Users\mayerk\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\extension.py", line 111, in load_jupyter_server_extension
info = get_app_info(app_dir)
File "C:\Users\mayerk\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\commands.py", line 244, in get_app_info
handler = _AppHandler(app_dir, logger)
File "C:\Users\mayerk\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\commands.py", line 324, in __init__
raise ValueError(msg)
ValueError: Please install nodejs 5+ and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website.
[I 09:30:37.410 NotebookApp] Serving notebooks from local directory: C:\Users\mayerk
[I 09:30:37.410 NotebookApp] 0 active kernels
[I 09:30:37.411 NotebookApp] The Jupyter Notebook is running at:
[I 09:30:37.411 NotebookApp] http://localhost:8891/?token=fe440f0ea50e716458013d568b6f94f4a1c498959e39e490
[I 09:30:37.411 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 09:30:37.420 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8891/?token=fe440f0ea50e716458013d568b6f94f4a1c498959e39e490
[I 09:30:37.557 NotebookApp] Accepting one-time-token-authenticated connection from ::1

ValueError: Please install nodejs 5+ and npm before continuing
installation. nodejs may be installed using conda or directly from the
nodejs website.
Try: conda install -y nodejs

Related

JupyterLab Windows 10 issues after updating to Anaconda 2021.05

I recently made a clean installation for Anaconda 2021.05.
After pip installing JupyterLab extensions and other libraries,
I observe major issues whenever I launch either a
jupyter notebook
jupyter lab
After a few minutes of work, my session crashes with the following message.
Any ideas where to look for debugging?
[I 2021-05-28 09:01:37.987 ServerApp] Saving file at /Untitled.ipynb
[I 2021-05-28 09:03:42.862 ServerApp] Kernel started: 1f6f770d-1093-46c5-897a-e25553d49593
Exception in thread Tornado selector:
Traceback (most recent call last):
File "C:\Softwares\Anaconda3\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Softwares\Anaconda3\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Softwares\Anaconda3\lib\site-packages\tornado\platform\asyncio.py", line 551, in _run_select
rs, ws, xs = select.select(to_read, to_write, to_write)
OSError: [WinError 10038] An operation was attempted on something that is not a socket

Application Launch Error Jupyter notebook

I installed PIP yesterday without knowing that it will affect Jupyter notebook now I have an application launch error whenever I try to open Jupyter notebook. In the past, I installed Jupyter notebook with Anaconda so I use either command or conda prompt to open Jupyter notebook. But now, I cant open Jupyter notebook and I have tried all the methods I know.
Currently, I have Jupyter notebook 5.0.0. If I update the application or uninstall Anaconda will it work?
I am currently stuck and I don't know how to solve this problem, any suggestions please? The error message is below:
Traceback (most recent call last):
File "c:\users\okekec\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec)
File "c:\users\okekec\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals)
File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\Scripts\jupyter-notebook.exe\__main__.py", line 5, in File "c:\users\okekec\appdata\local\continuum\anaconda3\lib\site-packages\notebook\__init__.py", line 25, in from .nbextensions import install_nbextension
File "c:\users\okekec\appdata\local\continuum\anaconda3\lib\site-packages\notebook\nbextensions.py", line 27, in from jupyter_core.utils import ensure_dir_exists
ImportError: cannot import name 'ensure_dir_exists'

How to Completely uninstall jupyter

I am unable to open jupyter notebook .ipynb files (i can open jupyter notebook, but when i click on a .ipynb it exits with unkown error)
Therefore i want to completely get rid of jupyter and ipython.
I deinstalled jupyter and ipython with sudo pip uninstall, also with pip2 and pip3, but still i am able to find jupyter at /usr/local/bin/jupyter and i am also able to start it with jupyter.
If i now reinstall jupyter with pip, i get the same errors as before, so i guess it always starts the same that i still installed.
So how can i deinstall this? just remove the binary?
Edit1:
i am using python 2.7 and Ubuntu 16.04 if that matters
Edit2:
i got basically the same problem as this pip uninstall jupyter does not work but which jupyter returns
Edit3:
The complete error output when i try to open a jupyter-notebook:
[E 14:59:58.222 NotebookApp] Uncaught exception GET /api/contents/workspace/Mobile_Mask_RCNN/samples/demo.ipynb?type=notebook&_=1523883598008 (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/contents/workspace/Mobile_Mask_RCNN/samples/demo.ipynb?type=notebook&_=1523883598008', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Accept-Language': 'de-DE,en-US;q=0.5', 'Accept-Encoding': 'gzip, deflate', 'X-Xsrftoken': '2|ef5ec4f7|efb210b548db14e572dec5fa47cd9d4c|1523879395', 'X-Requested-With': 'XMLHttpRequest', 'Host': 'localhost:8888', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0', 'Connection': 'keep-alive', 'Referer': 'http://localhost:8888/notebooks/workspace/Mobile_Mask_RCNN/samples/demo.ipynb', 'Cookie': '_xsrf=2|ef5ec4f7|efb210b548db14e572dec5fa47cd9d4c|1523879395; username-localhost-8888="2|1:0|10:1523883578|23:username-localhost-8888|44:YjJhYjc1MjI4Y2UwNDBlMDg1ZGJkN2QyMTkzZmM5ZGU=|c9400d948f07d89cf10b581a1251394138f0f7180395bdcffd5df47bd396c189"'})
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1512, in _execute
result = yield result
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1055, in run
value = future.result()
File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 307, in wrapper
yielded = next(result)
File "/usr/local/lib/python2.7/dist-packages/notebook/services/contents/handlers.py", line 112, in get
path=path, type=type, format=format, content=content,
File "/usr/local/lib/python2.7/dist-packages/notebook/services/contents/filemanager.py", line 418, in get
model = self._notebook_model(path, content=content)
File "/usr/local/lib/python2.7/dist-packages/notebook/services/contents/filemanager.py", line 378, in _notebook_model
self.mark_trusted_cells(nb, path)
File "/usr/local/lib/python2.7/dist-packages/notebook/services/contents/manager.py", line 502, in mark_trusted_cells
trusted = self.notary.check_signature(nb)
File "/usr/local/lib/python2.7/dist-packages/nbformat/sign.py", line 438, in check_signature
signature = self.compute_signature(nb)
File "/usr/local/lib/python2.7/dist-packages/nbformat/sign.py", line 413, in compute_signature
hmac = HMAC(self.secret, digestmod=self.digestmod)
File "/usr/local/lib/python2.7/dist-packages/traitlets/traitlets.py", line 556, in __get__
return self.get(obj, cls)
File "/usr/local/lib/python2.7/dist-packages/traitlets/traitlets.py", line 535, in get
value = self._validate(obj, dynamic_default())
File "/usr/local/lib/python2.7/dist-packages/nbformat/sign.py", line 387, in _secret_default
self._write_secret_file(secret)
File "/usr/local/lib/python2.7/dist-packages/nbformat/sign.py", line 397, in _write_secret_file
with io.open(self.secret_file, 'wb') as f:
IOError: [Errno 13] Permission denied: '/home/gustav/.local/share/jupyter/notebook_secret'
[W 14:59:58.223 NotebookApp] Unhandled error
[E 14:59:58.223 NotebookApp] {
"Accept-Language": "de-DE,en-US;q=0.5",
"Accept-Encoding": "gzip, deflate",
"X-Xsrftoken": "2|ef5ec4f7|efb210b548db14e572dec5fa47cd9d4c|1523879395",
"X-Requested-With": "XMLHttpRequest",
"Host": "localhost:8888",
"Accept": "application/json, text/javascript, */*; q=0.01",
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0",
"Connection": "keep-alive",
"Referer": "http://localhost:8888/notebooks/workspace/Mobile_Mask_RCNN/samples/demo.ipynb",
"Cookie": "_xsrf=2|ef5ec4f7|efb210b548db14e572dec5fa47cd9d4c|1523879395; username-localhost-8888=\"2|1:0|10:1523883578|23:username-localhost-8888|44:YjJhYjc1MjI4Y2UwNDBlMDg1ZGJkN2QyMTkzZmM5ZGU=|c9400d948f07d89cf10b581a1251394138f0f7180395bdcffd5df47bd396c189\""
}
[E 14:59:58.223 NotebookApp] 500 GET /api/contents/workspace/Mobile_Mask_RCNN/samples/demo.ipynb?type=notebook&_=1523883598008 (127.0.0.1) 37.67ms referer=http://localhost:8888/notebooks/workspace/Mobile_Mask_RCNN/samples/demo.ipynb
Fixing the jupyter error
You have a permissions issue:
IOError: [Errno 13] Permission denied: '/home/gustav/.local/share/jupyter/notebook_secret'
Uninstalling is not going to help, at least not directly. You might be able to fix it by entering this command in a terminal:
mkdir -p ${HOME}/.local/share/jupyter
This will fix the error if it was due to the .local/share/jupyter directory not existing.
Completely uninstalling jupyter
If you can't fix the permission issue, here's the simplest set of commands for nuking jupyter from space:
pip install pip-autoremove
pip-autoremove jupyter -y
From a little bit of testing I just did, you might also have to run at the end:
pip-autoremove jupyter-core -y
Opening .ipynb files with a doubleclick
You can't open .ipynb with just vanilla Jupyter by double clicking. This is by design (also arguably a design flaw, but eh). You can add this functionality with the nbopen project.
To install on Ubuntu, just run the following in a terminal:
python3 -m pip install nbopen
python3 -m nbopen.install_xdg
I haven't tested this though since I'm not running Linux.
How to open .ipynb files the "normal" way
You can't open .ipynb with just vanilla Jupyter by double clicking. This is by design (also arguably a design flaw, but eh).
Instead, you have to open files in the Jupyter file manager, which you run like this:
Open a new terminal window (in Ubuntu you can just enter Ctrl+Alt+T).
Start up the notebook server by running jupyter notebook
This should automatically open a new window in your internet browser that's pointing to the Jupyter file manager. If it doesn't, there'll be a line in your terminal that says something like
Copy/paste this URL into your browser when you connect for the first time, to login with a token:
In that case, just copy the following URL into the address bar of a browser window and hit enter.
You should now have a browser window showing the Jupyter file manager. Use the file manager to navigate to the .ipynb you want to open, and then just click on it.
Admittedly a bit convoluted, especially at first. I believe the reason Jupyter is set up this way goes back to its server-based architecture, and the fact that the design team wanted it to be easily/seamlessly deployed on remote computers.

Problems finding modules after installing SimpleCV 1.3

I have recently installed SimpleCV on Windows 10 from the superpack. Everything went well during the installation, and I was able to successfully run the first example problem in "Practical Computer Vision with SimpleCV" (good book, btw) from within IDLE. Here's the code:
from SimpleCV import Camera, Display, Image
cam = Camera()
display = Display()
img = cam.getImage()
img.save(display)
Simple enough, and it worked fine. Where I ran into problems was when I tried to start up the SimpleCV console. First of all, no link was created on the Windows desktop, and there was nothing for SimpleCV on the Start menu. So, I tried the other methods listed in the book. First, from the console, I tried to run it as a Python module:
C:\User> python -m SimpleCV.init
And what I got back was:
ERROR:
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\lib\site-packages\SimpleCV\__init__.py", line 18 in <module>
from SimpleCV.Shell import *
File "C:\Python27\;ib\site-packages\SimpleCV\Shell\__init__.py", line 1, in <module>
from Shell import *
File "C:\Python27\lib\site-packages\SimpleCV\Shell\Shell.py", line 54, in <module>
raise(e)
ImportError: No module named IPython
Next, I tried the listed alternative: just starting python and importing and executing the Shell. Entering:
>>> from SimpleCV import Shell
resulted in the same error as above.
I also tried installing ipython by running pip. But, it looks like pip didn't get installed either.
So, what environmental variable did the installation program not set correctly? Just so you know, I posted this same question on the SimpleCV site, but have not received a response as of yet.
--- 23 Dec 2015
Chipping away at this. Read the banner on setuputils install. Ran Python27\Scripts\easy_install.exe. Can now call pip. However, entering this at the command line:
C:\Users> pip install ipython
gives this error:
C:\Python27\lib\site--packages\pip-7.1.2-py2.7.egg\pip\_vendor\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cuase certain SSL connections to fail. For more information, see...
So, I'm making progress. Any suggestions?
Have you tried to install ipython from source code?
$ tar -xzf ipython.tar.gz
$ cd ipython
$ python setup.py install
See https://ipython.org/ipython-doc/3/install/install.html
There are a lot of requirements more. I recommend the SimpleCV's github repository instructions https://github.com/sightmachine/SimpleCV#windows-8

Running 'docker-compose up' raises "No module named fnctl" error on Windows

Setup:
Windows 7
Docker v1.6.0, installed as part of Boot2docker
Docker-compose v1.2.0
I installed docker-compose using pip:
pip install docker-compose
And it seemed to install successfully. However, when I try to run: docker-compose up in the directory in which I have my docker-compose.yml definition, I get the following exception:
Traceback (most recent call last):
File "c:\Python27\Scripts\docker-compose-script.py", line 9, in <module>
load_entry_point('docker-compose==1.2.0', 'console_scripts', 'docker-compose
')()
File "c:\Python27\lib\site-packages\pkg_resources.py", line 351, in load_entry
_point
return get_distribution(dist).load_entry_point(group, name)
File "c:\Python27\lib\site-packages\pkg_resources.py", line 2363, in load_entr
y_point
return ep.load()
File "c:\Python27\lib\site-packages\pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "c:\Python27\lib\site-packages\compose\cli\main.py", line 11, in <module>
import dockerpty
File "c:\Python27\lib\site-packages\dockerpty\__init__.py", line 17, in <modul
e>
from dockerpty.pty import PseudoTerminal
File "c:\Python27\lib\site-packages\dockerpty\pty.py", line 21, in <module>
import dockerpty.io as io
File "c:\Python27\lib\site-packages\dockerpty\io.py", line 18, in <module>
import fcntl
ImportError: No module named fcntl
I understand from different posts unrelated to docker that this error is thrown because fcntl is linux native and, obviously, my python windows distribution is missing it. However, the workarounds the people there specified don't necessarily apply to my personal case.
I also tried the steps here: https://github.com/docker/compose/releases
I downloaded the linux archive using curl (had no uname resolution) and gave execution right, but still:
$ docker-compose -version
./docker-compose: ./docker-compose: cannot execute binary file
Is anyone aware of any workarounds / actually functional ways of installing docker-compose on a Boot2docker VM?
You can run docker compose on boot2docker Windows.
You can install docker compose in a container directly in boot2docker and use it that way.
See "How to install docker-compose on Windows and issue 1085.

Resources