Notebook: Problem to launch jupyter notebook

Created on 29 Nov 2018  ·  19Comments  ·  Source: jupyter/notebook

Hi everyone,
I've already installed anaconda and start up anaconda prompt, but I cant start jupyter notebook in any way.
Also, I can't initiated anaconda navigator, anaconda prompt has recognised only
OS is W10.
Firewall is turn off.
message below
Many thanks

(base) C:Usersnenadzi>jupyter notebook

Traceback (most recent call last):

File "C:UsersnenadziAppDataLocalContinuumanaconda3Scriptsjupyter-notebook-script.py", line 6, in

from notebook.notebookapp import main

File "C:UsersnenadziAppDataLocalContinuumanaconda3libsite-packagesnotebooknotebookapp.py", line 61, in

from tornado import httpserver

File "C:UsersnenadziAppDataLocalContinuumanaconda3libsite-packagestornadohttpserver.py", line 33, in

from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters

File "C:UsersnenadziAppDataLocalContinuumanaconda3libsite-packagestornadohttp1connection.py", line 31, in

from tornado import iostream

File "C:UsersnenadziAppDataLocalContinuumanaconda3libsite-packagestornadoiostream.py", line 41, in

from tornado.netutil import ssl_wrap_socket, _client_ssl_defaults, _server_ssl_defaults

File "C:UsersnenadziAppDataLocalContinuumanaconda3libsite-packagestornadonetutil.py", line 45, in

ssl.Purpose.SERVER_AUTH)

File "C:UsersnenadziAppDataLocalContinuumanaconda3libssl.py", line 578, in create_default_context

context.load_default_certs(purpose)

File "C:UsersnenadziAppDataLocalContinuumanaconda3libssl.py", line 479, in load_default_certs

self._load_windows_store_certs(storename, purpose)

File "C:UsersnenadziAppDataLocalContinuumanaconda3libssl.py", line 471, in _load_windows_store_certs

self.load_verify_locations(cadata=certs)

ssl.SSLError: nested asn1 error (_ssl.c:3840)

(base) C:Usersnenadzi>

Most helpful comment

@pedjaziv
I manage to solve this problem by removing the:
if certs: self.load_verify_locations(cadata=certs)
from file "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libssl.py", lines 470 and 471

All 19 comments

I have no proper idea to suggest, but try updating the notebook with conda install notebook in the cmd prompt.

Hi Thomas

Hi Thomas
Thanks for suggestion, but unfortunately nothing happened.
I've tried the same instruction in the Anaconda Prompt, also
BR

Nenadzi, have you managed to solve this problem? I have the same problem with running jupyter notebook. I used to have all up and running, both anaconda 2 and anaconda 3 installed and then I have decided to re-install all and work only with anaconda 3 and now I can not make jupyter notebook work again . Log is bellow. Can somebody or you help? Thnx


Traceback (most recent call last):
File "C:UsersUSERNAMEAppDataLocalContinuumanaconda3Scriptsjupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libsite-packagesnotebooknotebookapp.py", line 61, in
from tornado import httpserver
File "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libsite-packagestornadohttpserver.py", line 33, in
from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters
File "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libsite-packagestornadohttp1connection.py", line 31, in
from tornado import iostream
File "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libsite-packagestornadoiostream.py", line 41, in
from tornado.netutil import ssl_wrap_socket, _client_ssl_defaults, _server_ssl_defaults
File "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libsite-packagestornadonetutil.py", line 45, in
ssl.Purpose.SERVER_AUTH)
File "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libssl.py", line 578, in create_default_context
context.load_default_certs(purpose)
File "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libssl.py", line 479, in load_default_certs
self._load_windows_store_certs(storename, purpose)
File "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libssl.py", line 471, in _load_windows_store_certs
self.load_verify_locations(cadata=certs)
ssl.SSLError: nested asn1 error (_ssl.c:3840)

Ok, I have the exact message (except the user name part)... I've tried what you've suggested over here, but nothing helped :(

Is anyone found solution by now?

Thank in advance

@pedjaziv , look into my comment here.

@pedjaziv
I manage to solve this problem by removing the:
if certs: self.load_verify_locations(cadata=certs)
from file "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libssl.py", lines 470 and 471

@pedjaziv
I manage to solve this problem by removing the:
if certs: self.load_verify_locations(cadata=certs)
from file "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libssl.py", lines 470 and 471

Thanks @r4m0 . This actually solved my problem.
I can verify that this problem is caused with certs from Serbian authorities.

Nicknames of people having a same problem indicates that this was an issue related to Balkan region, and now I'm 100% positive that those certs was a problem, because I had same problem on two machines where I have installed mentioned certs, and I had no issues on the other ones....

So once again, thank you and I want to thank @PaleNeutron also. I assume his method also works, but at the moment I need to keep those certs and cannot delete them.

Kind regards,
Pedja

I can verify that this problem is caused with certs from Serbian authorities.

@pedjaziv Exactly. I am from Serbia, Belgrade. I also did not want to delete those certs, so at the moment this was the only acceptable solution for me.

@pedjaziv
I manage to solve this problem by removing the:
if certs: self.load_verify_locations(cadata=certs)
from file "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libssl.py", lines 470 and 471

Hi @r4m0 @pedjaziv ,
I wasn't completely comfortable by removing completely the complete verification, so I added line at line 467:
if "MUP Republike Srbije" not in str(cert):
basically I instructed the function to ignore the certificates issued my MUP Rebuplike Srbije.

Now my _load_windows_store_certs function looks like this now (lines 460-473):
file: "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libssl.py"
`

def _load_windows_store_certs(self, storename, purpose):
    certs = bytearray()
    try:
        for cert, encoding, trust in enum_certificates(storename):
            # CA certs are never PKCS#7 encoded
            if encoding == "x509_asn":
                if trust is True or purpose.oid in trust:
                    if "MUP Republike Srbije" not in str(cert): 
                        certs.extend(cert)
    except PermissionError:
        warnings.warn("unable to enumerate Windows certificate store")
    if certs:
        self.load_verify_locations(cadata=certs)
    return certs`

But then again, I am not really an expert in this, and I didn't know much about ssl or CA before this, so I would welcome any feedback on what I did here, and what impact it could have.

Thanks,
Boris

Thanks Boris !
Your ssl.py mod works. Craziest python error I ran into so far :)

Hi,
I had the same issue and I solved it by uninstalling "Čitač elektronske lične karte" from Windows 10. :)
I was inspired with your answers and remember what was the last app I installed from MUP and that was it :) Thanks.

I had the same issue. Copying the following dlls (libcrypto-1_1-x64.dll, libssl-1_1-x64.dll) from C:ProgramDataAnaconda3Librarybin to C:ProgramDataAnaconda3DLLs solved my issue. This is on Windows 10 with Anaconda3 64-bit.

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/jupyter-not-starting/3461/2

Hi,
I had the same issue and I solved it by uninstalling "Čitač elektronske lične karte" from Windows 10. :)
I was inspired with your answers and remember what was the last app I installed from MUP and that was it :) Thanks.

Same for me, this resolved my issue, thank you.

@pedjaziv
I manage to solve this problem by removing the:
if certs: self.load_verify_locations(cadata=certs)
from file "C:UsersUSERNAMEAppDataLocalContinuumanaconda3libssl.py", lines 470 and 471

hi! i am facing with the same issue. i cant start the jupyter or anaconda, dunno why. how did u solve it in cmd prompt or? thanks, vera

this is my eror constantly.

(base) C:UsersVera> jupyter notebook
Traceback (most recent call last):
File "C:UsersVeraanaconda3Scriptsjupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:UsersVeraanaconda3libsite-packagesnotebooknotebookapp.py", line 64, in
from tornado import httpserver
File "C:UsersVeraanaconda3libsite-packagestornadohttpserver.py", line 32, in
from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters
File "C:UsersVeraanaconda3libsite-packagestornadohttp1connection.py", line 33, in
from tornado import httputil
File "C:UsersVeraanaconda3libsite-packagestornadohttputil.py", line 28, in
import http.cookies
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 779, in exec_module
File "", line 915, in get_code
File "", line 973, in get_data
OSError: [Errno 9] Bad file descriptor

Hi @vera942,

The error seems like a general issue when handling the file for reading or writing. The file is locked for some reason and that may be causing an issue. I might recommend completely uninstalling Anaconda and then reinstalling it somewhere other then C:UsersVeraanaconda3, even maybe on some other drive. If that doesn't solve the issue, there may be some other issue with your system.

i solved it. reinstall the OS. thanks anyway :)

Vera Dimitrievska
https://www.kaggle.com/vdimitrievska/notebooks
https://github.com/vera942?tab=repositories
www.verevere.wordpress.com
T in NL: +31644801757
T in MKD: + 389 77 503699
skype name:veravera942

On Sat, 19 Sep 2020 at 23:58, Ramadan Halili notifications@github.com
wrote:

Hi @vera942 https://github.com/vera942,

The error seems like a general issue when handling the file for reading or
writing. The file is locked for some reason and that may be causing an
issue. I might recommend completely uninstalling Anaconda and then
reinstalling it somewhere other then C:UsersVeraanaconda3, even maybe on
some other drive. If that doesn't solve the issue, there may be some other
issue with your system.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jupyter/notebook/issues/4245#issuecomment-695360291,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AF5NP64BOHZDGHDBNV5XVXLSGUSRDANCNFSM4GHIU66Q
.

So far, deleting
if cert:
self.load_verify_locations(cadata=certs)
solved my problem.
On the other hand, adding up
if "MUP Republike Srbije" not in str(cert):
did not work for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cmesro picture cmesro  ·  3Comments

itoed picture itoed  ·  3Comments

mowe96 picture mowe96  ·  3Comments

ehossain1982 picture ehossain1982  ·  3Comments

jonatanblue picture jonatanblue  ·  3Comments