jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.37k stars 4.73k forks source link

Problem to launch jupyter notebook #4245

Open nenadzi opened 5 years ago

nenadzi commented 5 years ago

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 commented 5 years ago

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

nenadzi commented 5 years ago

Hi Thomas

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

Yassica commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

@pedjaziv , look into my comment here.

r4m0 commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

@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 commented 4 years ago

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

rupurut commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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:\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.

— 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 .

goranad77 commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.

https://github.com/jupyter/notebook/issues/4245#issuecomment-464655579

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

goranad77 commented 2 years ago

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 commented 2 years ago

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

LukaMacesic commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 11 months ago

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.