Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem to launch jupyter notebook #4245

Open
nenadzi opened this issue Nov 29, 2018 · 30 comments
Open

Problem to launch jupyter notebook #4245

nenadzi opened this issue Nov 29, 2018 · 30 comments

Comments

@nenadzi
Copy link

nenadzi commented Nov 29, 2018

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:\Users\nenadzi>jupyter notebook

Traceback (most recent call last):

File "C:\Users\nenadzi\AppData\Local\Continuum\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in

from notebook.notebookapp import main

File "C:\Users\nenadzi\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\notebookapp.py", line 61, in

from tornado import httpserver

File "C:\Users\nenadzi\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\httpserver.py", line 33, in

from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters

File "C:\Users\nenadzi\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\http1connection.py", line 31, in

from tornado import iostream

File "C:\Users\nenadzi\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\iostream.py", line 41, in

from tornado.netutil import ssl_wrap_socket, _client_ssl_defaults, _server_ssl_defaults

File "C:\Users\nenadzi\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\netutil.py", line 45, in

ssl.Purpose.SERVER_AUTH)

File "C:\Users\nenadzi\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 578, in create_default_context

context.load_default_certs(purpose)

File "C:\Users\nenadzi\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 479, in load_default_certs

self._load_windows_store_certs(storename, purpose)

File "C:\Users\nenadzi\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 471, in _load_windows_store_certs

self.load_verify_locations(cadata=certs)

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

(base) C:\Users\nenadzi>

@thomasaarholt
Copy link
Contributor

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

@nenadzi
Copy link
Author

nenadzi commented Nov 30, 2018

Hi Thomas

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

@Yassica
Copy link

Yassica commented Dec 6, 2018

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:\Users\USERNAME\AppData\Local\Continuum\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\notebookapp.py", line 61, in
from tornado import httpserver
File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\httpserver.py", line 33, in
from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters
File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\http1connection.py", line 31, in
from tornado import iostream
File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\iostream.py", line 41, in
from tornado.netutil import ssl_wrap_socket, _client_ssl_defaults, _server_ssl_defaults
File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\site-packages\tornado\netutil.py", line 45, in
ssl.Purpose.SERVER_AUTH)
File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 578, in create_default_context
context.load_default_certs(purpose)
File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 479, in load_default_certs
self._load_windows_store_certs(storename, purpose)
File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\ssl.py", line 471, in _load_windows_store_certs
self.load_verify_locations(cadata=certs)
ssl.SSLError: nested asn1 error (_ssl.c:3840)

@pedjaziv
Copy link

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

@PaleNeutron
Copy link

PaleNeutron commented Jan 21, 2019

@pedjaziv , look into my comment here.

@r4m0
Copy link

r4m0 commented Feb 3, 2019

@pedjaziv
I manage to solve this problem by removing the:
if certs: self.load_verify_locations(cadata=certs)
from file "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\ssl.py", lines 470 and 471

@pedjaziv
Copy link

@pedjaziv
I manage to solve this problem by removing the:
if certs: self.load_verify_locations(cadata=certs)
from file "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\ssl.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

@r4m0
Copy link

r4m0 commented Feb 18, 2019

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.

@BorisStricky
Copy link

BorisStricky commented Feb 27, 2019

@pedjaziv
I manage to solve this problem by removing the:
if certs: self.load_verify_locations(cadata=certs)
from file "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\ssl.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:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\ssl.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

@popmilo
Copy link

popmilo commented Aug 19, 2019

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

@rupurut
Copy link

rupurut commented Aug 28, 2019

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.

@priyaranjan-tokachichu
Copy link

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

@meeseeksmachine
Copy link

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

@ghost
Copy link

ghost commented Mar 31, 2020

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.

@vera942
Copy link

vera942 commented Sep 19, 2020

@pedjaziv
I manage to solve this problem by removing the:
if certs: self.load_verify_locations(cadata=certs)
from file "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\lib\ssl.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

@vera942
Copy link

vera942 commented Sep 19, 2020

this is my eror constantly.

(base) C:\Users\Vera> jupyter notebook
Traceback (most recent call last):
File "C:\Users\Vera\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:\Users\Vera\anaconda3\lib\site-packages\notebook\notebookapp.py", line 64, in
from tornado import httpserver
File "C:\Users\Vera\anaconda3\lib\site-packages\tornado\httpserver.py", line 32, in
from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters
File "C:\Users\Vera\anaconda3\lib\site-packages\tornado\http1connection.py", line 33, in
from tornado import httputil
File "C:\Users\Vera\anaconda3\lib\site-packages\tornado\httputil.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

@r4m0
Copy link

r4m0 commented Sep 19, 2020

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:\Users\Vera\anaconda3, even maybe on some other drive. If that doesn't solve the issue, there may be some other issue with your system.

@vera942
Copy link

vera942 commented Sep 20, 2020 via email

@goranad77
Copy link

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

@Alexander-Serov
Copy link

If someone has solved this problem (after package update, very annoying), could you please share your fix?

My error log reads:

✗ jupyter notebook
Traceback (most recent call last):
  File "c:\tools\miniconda3\envs\pv-surprod\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\tools\miniconda3\envs\pv-surprod\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\tools\miniconda3\envs\pv-surprod\Scripts\jupyter-notebook.EXE\__main__.py", line 4, in <module>
  File "c:\tools\miniconda3\envs\pv-surprod\lib\site-packages\notebook\notebookapp.py", line 60, in <module>
    from tornado import httpserver
  File "c:\tools\miniconda3\envs\pv-surprod\lib\site-packages\tornado\httpserver.py", line 32, in <module>
    from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters
  File "c:\tools\miniconda3\envs\pv-surprod\lib\site-packages\tornado\http1connection.py", line 34, in <module>
    from tornado import iostream
  File "c:\tools\miniconda3\envs\pv-surprod\lib\site-packages\tornado\iostream.py", line 40, in <module>
    from tornado.netutil import ssl_wrap_socket, _client_ssl_defaults, _server_ssl_defaults
  File "c:\tools\miniconda3\envs\pv-surprod\lib\site-packages\tornado\netutil.py", line 34, in <module>
    _client_ssl_defaults = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
  File "c:\tools\miniconda3\envs\pv-surprod\lib\ssl.py", line 589, in create_default_context
    context.load_default_certs(purpose)
  File "c:\tools\miniconda3\envs\pv-surprod\lib\ssl.py", line 490, in load_default_certs
    self._load_windows_store_certs(storename, purpose)
  File "c:\tools\miniconda3\envs\pv-surprod\lib\ssl.py", line 482, in _load_windows_store_certs
    self.load_verify_locations(cadata=certs)
ssl.SSLError: unknown error (_ssl.c:4034)

@goranad77
Copy link

goranad77 commented Oct 13, 2021

Iz looks to me the same issue people are facing in Serbia and some other countries due to issue with SSL certificates. I followed instructions for some "solutions" with no result. Finally, I had to install jupyter on the computer without SSL certificates.

@pedjaziv
Copy link

Iz looks to me the same issue people are facing in Serbia and some other countries due to issue with SSL certificates. I followed instructions for some "solutions" with no result. Finally, I had to install jupyter on the computer without SSL certificates.

#4245 (comment)

Couldn't be more precise from this. This actually solved my problem without deleting certs.

@goranad77
Copy link

Deleting
if cert:
self.load_verify_locations(cadata=certs)
solved my problem for short period of time. The problem occurred again and I changed PC. Can not be more precise. It happened a year ago.

@vedraan
Copy link

vedraan commented Apr 3, 2022

For Anaconda3-2021.11 and Serbian "MUP Republike Srbije" cert this issue can be solved by editing anaconda3\Lib\ssl.py just below this line (561 in current anaconda version, but best use search):

                    if trust is True or purpose.oid in trust:

add one additional line below it, so it looks like this:

                    if trust is True or purpose.oid in trust:
                        if "MUP Republike Srbije" not in str(cert):
                            certs.extend(cert)

This pretty much fixed it for me, all credits go to: https://algora.petlja.org/t/python-instalacija-windows/999/8

@ghost
Copy link

ghost commented Mar 19, 2023

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 spent 3 days trying to figure out why i cant use streamlit and i realy cant believe this is the reason... Hvala :)

@DzenisKoca
Copy link

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 spent 3 days trying to figure out why i cant use streamlit and i realy cant believe this is the reason... Hvala :)

Same here!!! just remove the application!!

@Bootris
Copy link

Bootris commented Jun 5, 2023

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 here, this resolved my issue, thank you!

@lunaQi
Copy link

lunaQi commented Aug 3, 2023

i encounted the same problem on lauching pyspider in conda 23.5.2 on Win10. Removing ssl.py line 588 and 589 true works for me. Besides i've tried to add a certificate by "conda install certifi" and give its path to ssl_verify, however it doesn't work.

@vesnahrnjaksivcev
Copy link

Posle više dana, rešenje je bilo sledeće: uninstalirala sam čitač elektronske karte sa računara i automatski sam ponovo pokrenula Jupyter iz Anaconde. Ne mogu da verujem da je čitač pravio problem.

@DLumi
Copy link

DLumi commented Dec 16, 2024

Just to add to what @BorisStricky have advised:
If you happen to use ASSECO 24x7 banking app, then you need to exclude those certificates as well, cause they seem to have the same issue.

if "24x7.co.yu" not in str(cert): 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests