1

I'm having trouble running Jupyter notebook with my (fresh) conda distribution on W10.

First, I create a new environment with standard packages like pandas, requests, etc. Then I want to link the environment with Jupyter, so I follow this guide, ie I simply install ipykernel with conda install ipykernel.

The installation goes through successfully, but for some reason, it also removes python.exe from ~\Anaconda3\envs\my_env directory. But conda still thinks everything is working, but running python command opens MS store.

A snippet of installed packages with python present: Snippet of installed packages

Does anybody have any idea what might be the issue here? Thanks in advance

edit: content of env history file

==> 2019-05-17 18:28:42 <== # cmd: C:\Users\pavel\Anaconda3\Scripts\conda-script.py create --name cz_unemployment python=3.7 pandas requests sqlalchemy dash xlrd lxml beautifulsoup4 # conda version: 4.6.14 +conda-forge::asn1crypto-0.24.0-py37_1003 +conda-forge::attrs-19.1.0-py_0 +conda-forge::beautifulsoup4-4.7.1-py37_1001 +conda-forge::ca-certificates-2019.3.9-hecc5488_0 +conda-forge::certifi-2019.3.9-py37_0 +conda-forge::cffi-1.12.3-py37hb32ad35_0 +conda-forge::chardet-3.0.4-py37_1003 +conda-forge::click-7.0-py_0 +conda-forge::cryptography-2.6.1-py37hb32ad35_0 +conda-forge::dash-0.43.0-py_0 +conda-forge::dash-core-components-0.48.0-py_0 +conda-forge::dash-html-components-0.16.0-py_0 +conda-forge::dash-renderer-0.24.0-py_0 +conda-forge::dash-table-3.7.0-py_0 +conda-forge::decorator-4.4.0-py_0 +conda-forge::flask-1.0.2-py_2 +conda-forge::flask-compress-1.4.0-py_0 +conda-forge::idna-2.8-py37_1000 +conda-forge::ipython_genutils-0.2.0-py_1 +conda-forge::itsdangerous-1.1.0-py_0 +conda-forge::jinja2-2.10.1-py_0 +conda-forge::jsonschema-3.0.1-py37_0 +conda-forge::jupyter_core-4.4.0-py_0 +conda-forge::libblas-3.8.0-10_mkl +conda-forge::libcblas-3.8.0-10_mkl +conda-forge::libiconv-1.15-hfa6e2cd_1005 +conda-forge::liblapack-3.8.0-10_mkl +conda-forge::libxml2-2.9.9-h9ce36c8_0 +conda-forge::libxslt-1.1.32-heafd4d3_1002 +conda-forge::lxml-4.3.3-py37heafd4d3_0 +conda-forge::markupsafe-1.1.1-py37hfa6e2cd_0 +conda-forge::nbformat-4.4.0-py_1 +conda-forge::numpy-1.16.3-py37h873a0b8_0 +conda-forge::openssl-1.1.1b-hfa6e2cd_2 +conda-forge::pandas-0.24.2-py37h6538335_0 +conda-forge::pip-19.1.1-py37_0 +conda-forge::plotly-3.9.0-py_0 +conda-forge::pycparser-2.19-py37_1 +conda-forge::pyopenssl-19.0.0-py37_0 +conda-forge::pyrsistent-0.15.2-py37hfa6e2cd_0 +conda-forge::pysocks-1.7.0-py37_0 +conda-forge::python-3.7.3-hb12ca83_0 +conda-forge::python-dateutil-2.8.0-py_0 +conda-forge::pytz-2019.1-py_0 +conda-forge::requests-2.22.0-py37_0 +conda-forge::retrying-1.3.3-py_2 +conda-forge::setuptools-41.0.1-py37_0 +conda-forge::six-1.12.0-py37_1000 +conda-forge::soupsieve-1.9.1-py37_0 +conda-forge::sqlalchemy-1.3.3-py37hfa6e2cd_0 +conda-forge::sqlite-3.26.0-hfa6e2cd_1001 +conda-forge::traitlets-4.3.2-py37_1000 +conda-forge::urllib3-1.24.3-py37_0 +conda-forge::vc-14-0 +conda-forge::vs2015_runtime-14.0.25420-0 +conda-forge::werkzeug-0.15.4-py_0 +conda-forge::wheel-0.33.4-py37_0 +conda-forge::win_inet_pton-1.1.0-py37_0 +conda-forge::wincertstore-0.2-py37_1002 +conda-forge::xlrd-1.2.0-py_0 +conda-forge::zlib-1.2.11-h2fa13f4_1004 +defaults::intel-openmp-2019.3-203 +defaults::mkl-2019.3-203 # update specs: ['python=3.7', 'dash', 'pandas', 'requests', 'lxml', 'xlrd', 'beautifulsoup4', 'sqlalchemy'] ==> 2019-05-17 18:42:25 <== # cmd: C:\Users\pavel\Anaconda3\Scripts\conda-script.py install ipykernel # conda version: 4.6.14 +conda-forge::backcall-0.1.0-py_0 +conda-forge::colorama-0.4.1-py_0 +conda-forge::ipykernel-5.1.1-py37h39e3cac_0 +conda-forge::ipython-7.5.0-py37h39e3cac_0 +conda-forge::jedi-0.13.3-py37_0 +conda-forge::jupyter_client-5.2.4-py_3 +conda-forge::libsodium-1.0.16-h2fa13f4_1001 +conda-forge::parso-0.4.0-py_0 +conda-forge::pickleshare-0.7.5-py37_1000 +conda-forge::prompt_toolkit-2.0.9-py_0 +conda-forge::pygments-2.4.0-py_0 +conda-forge::pyzmq-18.0.1-py37he7828b0_1 +conda-forge::tornado-6.0.2-py37hfa6e2cd_0 +conda-forge::wcwidth-0.1.7-py_1 +conda-forge::zeromq-4.3.1-he025d50_1000 # update specs: ['ipykernel'] 

Edit2: Its not ipykernel instalation, that removes the executable, rather it's running Jupyter notebook from Base env and then trying to use my_env as kernel, which removes it. Bellow is a terminal output of my attempt to use my_env as a kernel in Jupyter Notebook.

(base) PS>jupyter notebook [I 07:53:17.685 NotebookApp] [nb_conda_kernels] enabled, 5 kernels found [I 07:53:19.072 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.4.1 [I 07:53:19.118 NotebookApp] JupyterLab extension loaded from C:\Users\pavel\Anaconda3\lib\site-packages\jupyterlab [I 07:53:19.118 NotebookApp] JupyterLab application directory is C:\Users\pavel\Anaconda3\share\jupyter\lab [I 07:53:19.131 NotebookApp] [nb_conda] enabled [I 07:53:19.132 NotebookApp] Serving notebooks from local directory: C:\Users\pavel [I 07:53:19.132 NotebookApp] The Jupyter Notebook is running at: [I 07:53:19.141 NotebookApp] http://localhost:8888/?token=3b8205fe5ac24c04dfb55de2b39cd0af5c32b2787904bfe7 [I 07:53:19.143 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 07:53:19.281 NotebookApp] To access the notebook, open this file in a browser: file:///C:/Users/pavel/AppData/Roaming/jupyter/runtime/nbserver-19468-open.html Or copy and paste one of these URLs: http://localhost:8888/?token=3b8205fe5ac24c04dfb55de2b39cd0af5c32b2787904bfe7 [I 07:53:26.349 NotebookApp] Creating new notebook in [I 07:53:27.874 NotebookApp] Kernel started: 04f9da1b-eee5-4474-83a6-21e51b1b83dc [I 07:53:30.684 NotebookApp] Adapting to protocol v5.1 for kernel 04f9da1b-eee5-4474-83a6-21e51b1b83dc [I 07:53:39.852 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports kernel 04f9da1b-eee5-4474-83a6-21e51b1b83dc restarted Traceback (most recent call last): File "C:\Users\pavel\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\pavel\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\pavel\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 72, in <module> exec_in_env(*(sys.argv[1:])) File "C:\Users\pavel\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 66, in exec_in_env Popen((fullpath,) + args, env=env).wait() File "C:\Users\pavel\Anaconda3\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "C:\Users\pavel\Anaconda3\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified [I 07:53:42.853 NotebookApp] KernelRestarter: restarting kernel (2/5), keep random ports kernel 04f9da1b-eee5-4474-83a6-21e51b1b83dc restarted Traceback (most recent call last): File "C:\Users\pavel\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\pavel\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\pavel\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 72, in <module> exec_in_env(*(sys.argv[1:])) File "C:\Users\pavel\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 66, in exec_in_env Popen((fullpath,) + args, env=env).wait() File "C:\Users\pavel\Anaconda3\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "C:\Users\pavel\Anaconda3\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified [I 07:53:45.852 NotebookApp] KernelRestarter: restarting kernel (3/5), keep random ports kernel 04f9da1b-eee5-4474-83a6-21e51b1b83dc restarted Traceback (most recent call last): File "C:\Users\pavel\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\pavel\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\pavel\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 72, in <module> exec_in_env(*(sys.argv[1:])) File "C:\Users\pavel\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 66, in exec_in_env Popen((fullpath,) + args, env=env).wait() File "C:\Users\pavel\Anaconda3\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "C:\Users\pavel\Anaconda3\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified [I 07:53:48.867 NotebookApp] KernelRestarter: restarting kernel (4/5), keep random ports kernel 04f9da1b-eee5-4474-83a6-21e51b1b83dc restarted Traceback (most recent call last): File "C:\Users\pavel\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\pavel\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\pavel\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 72, in <module> exec_in_env(*(sys.argv[1:])) File "C:\Users\pavel\Anaconda3\lib\site-packages\nb_conda_kernels\runner.py", line 66, in exec_in_env Popen((fullpath,) + args, env=env).wait() File "C:\Users\pavel\Anaconda3\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "C:\Users\pavel\Anaconda3\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified [W 07:53:51.898 NotebookApp] KernelRestarter: restart failed [W 07:53:51.898 NotebookApp] Kernel 04f9da1b-eee5-4474-83a6-21e51b1b83dc died, removing from map. kernel 04f9da1b-eee5-4474-83a6-21e51b1b83dc restarted failed! [W 07:53:51.937 NotebookApp] 410 DELETE /api/sessions/db5227d1-0f2a-4c8a-9645-29a94e012dd9 (::1): Kernel deleted before session [W 07:53:51.939 NotebookApp] Kernel deleted before session [W 07:53:51.946 NotebookApp] 410 DELETE /api/sessions/db5227d1-0f2a-4c8a-9645-29a94e012dd9 (::1) 9.97ms referer=http://localhost:8888/notebooks/Untitled1.ipynb?kernel_name=conda-env-tmp_omg-py 
2
  • I'd like to see the ~\Anaconda3\envs\my_env\conda-meta\history file, to see the actual transactions that occurred. You verified the python worked prior to the ipykernel install? Commented May 17, 2019 at 17:37
  • 1
    The env worked. I've also edited the question to contain history file content. Commented May 17, 2019 at 18:31

1 Answer 1

1

Figured out the issue. Antivirus software marks python as a threat, as mentioned here

Sign up to request clarification or add additional context in comments.

1 Comment

Interesting finding !

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.