Cant Launch Jupyter Notebook - python

Im still a newbie in anaconda, python and jupyter notebook.
I am doing my assignment which is exploring anaconda and jupyter.
windows 10, 64bit
python 3.6.4
anaconda 4.4.10
Why I cant launch jupyter notebook? First time i tried it was successful. And i continue with importing the libraries. Then, when the next time i open anaconda prompt and tried jupyter notebook , i got this error:
Traceback (most recent call last):
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pkg_resources__init__.py", line 2760, in get_entry_map
ep_map = self._ep_map
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pkg_resources__init__.py", line 2731, in getattr
raise AttributeError(attr)
AttributeError: _ep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\LENOVO\Anaconda3\Scripts\jupyter-notebook-script.py", line 10, in
sys.exit(main())
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\jupyter_core\application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\traitlets\config\application.py", line 657, in launch_instance
app.initialize(argv)
File "", line 2, in initialize
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1507, in initialize
self.init_webapp()
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1270, in init_webapp
self.jinja_environment_options
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 156, in init
default_url, settings_overrides, jinja_env_options)
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 268, in init_settings
nbextensions_path=jupyter_app.nbextensions_path,
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 973, in nbextensions_path
from IPython.paths import get_ipython_dir
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\IPython__init__.py", line 55, in
from .terminal.embed import embed
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\IPython\terminal\embed.py", line 16, in
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 91, in
class TerminalInteractiveShell(InteractiveShell):
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 134, in TerminalInteractiveShell
highlighting: \n %s""" % ', '.join(get_all_styles())
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pygments\styles__init__.py", line 79, in get_all_styles
for name, _ in find_plugin_styles():
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pygments\plugin.py", line 62, in find_plugin_styles
for entrypoint in iter_entry_points(STYLE_ENTRY_POINT):
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pkg_resources__init__.py", line 737, in iter_entry_points
entries = dist.get_entry_map(group)
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pkg_resources__init__.py", line 2763, in get_entry_map
self._get_metadata('entry_points.txt'), self
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pkg_resources__init__.py", line 2496, in parse_map
raise ValueError("Entry points must be listed in groups")
ValueError: Entry points must be listed in groups
Is a big thank you if anyone can help me solve this! :)
Feel free to drop any comment/suggestion. Thank you!!

First of all i recommend to re install anaconda again and to select the check box which says to Set Anaconda path in system so that you can use it from anywhere.
To make sure that we are going in right direction go to the bin/ in the anaconda folder.
once you are in bin you can see that there is a jupyter-notebook.exe thus execute it in the command prompt.
Also you can try using Anaconda Navigator to do the same thing.
You can also try running it as Administrator if there are any permission issues.
There have been changes in jupyter notebooks latest release so you can read the docs for more info

Related

Can't run jupyter notebook with pip

Just trying to run jupyter notebook with pip. What the hell is happening? I tried to run it like this "python -m notebook", because just "jupyter notebook" or just "notebook" doesn't even get recognized.
C:\**\**>python -m notebook
Traceback (most recent call last):
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\runpy.py",
line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\runpy.py",
line 86, in _run_code
exec(code, run_globals)
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\notebook\__main__.py", line 5, in <module>
app.launch_new_instance()
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\jupyter_core\application.py", line 268, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\traitlets\config\application.py", line 663, in launch_instance
app.initialize(argv)
File "<C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packa
ges\decorator.py:decorator-gen-7>", line 2, in initialize
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\traitlets\config\application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\notebook\notebookapp.py", line 1720, in initialize
self.init_webapp()
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\notebook\notebookapp.py", line 1482, in init_webapp
self.http_server.listen(port, self.ip)
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\tornado\tcpserver.py", line 152, in listen
self.add_sockets(sockets)
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\tornado\tcpserver.py", line 165, in add_sockets
self._handlers[sock.fileno()] = add_accept_handler(
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\tornado\netutil.py", line 279, in add_accept_handler
io_loop.add_handler(sock, accept_handler, IOLoop.READ)
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\site-packag
es\tornado\platform\asyncio.py", line 99, in add_handler
self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
File "C:\**\**\AppData\Local\Programs\Python\Python38-32\lib\asyncio\eve
nts.py", line 501, in add_reader
raise NotImplementedError
NotImplementedError
Your local installation of jupyter via pip is conflicting with your Anaconda installation. There are some situations where you may need more than one instance of python (e.g. if you need to test code with different versions of python, or some applications require a separate instance, but you seem like you might want to limit your installations to just a single instance.
Remember to use environments to keep your package list clean.

Python pytest hangs. For instance, "pytest --version" simply hangs

The following hangs:
PS C:\Users\Fowler> pytest --version
Notes:
I am in Windows 10.
By hang, I mean at least 5 minutes of waiting for the pytest --version to return...
While waiting for pytest, python.exe is using 100% of a logical processor on my computer.
I uninstalled all python installations with windows installer and I reinistalled python 3.8.0 in an attempt to fix.
pytest only fails when I am not using a venv. So, pytest does work using a venv.
However, I can't use a venv with vscode, because debugging with venv gives a strange "Session-1 timed out waiting for debuggee to spawn" <-- you would think the word debuggee would be a nice clue, but not much found with that word on google. I am guessing this is a different problem, but maybe related?
In summary, I can't debug python with a venv, and I can't run pytest unit tests without a venv. Probably, these items are unrelated... But, because of this catch-22, I will be sooo grateful for any hints to fix either problem.
When I hit <ctrl-c> to break out of the pytest "hang", the following is displayed (but changes a little bit at the end each time?:
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python38\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\Scripts\pytest.exe\__main__.py", line 7, in <module>
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\_pytest\config\__init__.py", line 72, in main
config = _prepareconfig(args, plugins)
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\_pytest\config\__init__.py", line 222, in _prepareconfig
return pluginmanager.hook.pytest_cmdline_parse(
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\pluggy\hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\pluggy\manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\pluggy\manager.py", line 84, in <lambda>
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\pluggy\callers.py", line 203, in _multicall
gen.send(outcome)
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\_pytest\helpconfig.py", line 89, in pytest_cmdline_parse
config = outcome.get_result()
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\pluggy\callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\pluggy\callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\_pytest\config\__init__.py", line 742, in pytest_cmdline_parse
self.parse(args)
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\_pytest\config\__init__.py", line 948, in parse
self._preparse(args, addopts=addopts)
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\_pytest\config\__init__.py", line 896, in _preparse
self.pluginmanager.load_setuptools_entrypoints("pytest11")
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\pluggy\manager.py", line 299, in load_setuptools_entrypoints
plugin = ep.load()
File "c:\program files\python38\lib\importlib\metadata.py", line 75, in load
module = import_module(match.group('module'))
File "c:\program files\python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\_pytest\assertion\rewrite.py", line 138, in exec_module
_write_pyc(state, co, source_stat, pyc)
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\_pytest\assertion\rewrite.py", line 274, in _write_pyc
with atomic_write(fspath(pyc), mode="wb", overwrite=True) as fp:
File "c:\program files\python38\lib\contextlib.py", line 113, in __enter__
return next(self.gen)
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\atomicwrites\__init__.py", line 156, in _open
with get_fileobject(**self._open_kwargs) as f:
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\atomicwrites\__init__.py", line 173, in get_fileobject
descriptor, name = tempfile.mkstemp(suffix=suffix, prefix=prefix,
File "c:\program files\python38\lib\tempfile.py", line 332, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "c:\program files\python38\lib\tempfile.py", line 247, in _mkstemp_inner
file = _os.path.join(dir, pre + name + suf)
KeyboardInterrupt
The next time try to run pytest --version and I hit <ctrl-c> it ends with:
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
...
...
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\atomicwrites\__init__.py", line 173, in get_fileobject
descriptor, name = tempfile.mkstemp(suffix=suffix, prefix=prefix,
File "c:\program files\python38\lib\tempfile.py", line 332, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "c:\program files\python38\lib\tempfile.py", line 248, in _mkstemp_inner
_sys.audit("tempfile.mkstemp", file)
KeyboardInterrupt
The next time try to run pytest --version and I hit <ctrl-c> it ends with:
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
...
...
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\atomicwrites\__init__.py", line 173, in get_fileobject
descriptor, name = tempfile.mkstemp(suffix=suffix, prefix=prefix,
File "c:\program files\python38\lib\tempfile.py", line 332, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "c:\program files\python38\lib\tempfile.py", line 256, in _mkstemp_inner
if (_os.name == 'nt' and _os.path.isdir(dir) and
File "c:\program files\python38\lib\genericpath.py", line 42, in isdir
st = os.stat(s)
KeyboardInterrupt
The next time try to run pytest --version and I hit <ctrl-c> it ends with:
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
...
...
File "C:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\atomicwrites\__init__.py", line 173, in get_fileobject
descriptor, name = tempfile.mkstemp(suffix=suffix, prefix=prefix,
File "c:\program files\python38\lib\tempfile.py", line 332, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "c:\program files\python38\lib\tempfile.py", line 250, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
KeyboardInterrupt
I don't know if this output will help, but I thought it might be useful to see all the locations on my machine where python and/or pytest are installed:
PS C:\Users\Fowler> where.exe /r c:\ python
c:\Program Files\Amazon\AWSCLI\runtime\python.exe
c:\Program Files\Amazon\AWSSAMCLI\runtime\python.exe
c:\Program Files\MySQL\MySQL Workbench 8.0 CE\python.exe
c:\Program Files\Python38\python.exe
c:\Program Files\Python38\Lib\venv\scripts\nt\python.exe
c:\Users\Fowler\.vscode\extensions\lextudio.restructuredtext-116.0.0\out\python.js
c:\Users\Fowler\.vscode\extensions\teabyii.ayu-0.18.0\test\Python.py
c:\Users\Fowler\.vscode\extensions\yzane.markdown-pdf-1.4.1\node_modules\highlight.js\lib\languages\python.js
c:\Users\Fowler\AppData\Local\GitHubDesktop\app-2.2.2\resources\app\highlighter\mode\python.js
c:\Users\Fowler\AppData\Local\GitHubDesktop\app-2.2.3\resources\app\highlighter\mode\python.js
c:\Users\Fowler\AppData\Local\Google\Chrome\User Data\Default\Extensions\ngkhgikojglcgnckopipfdajaifmmnnc\4.1.34_0\python.js
c:\Users\Fowler\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\etc\apparmor.d\abstractions\python
c:\Users\Fowler\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\usr\share\bash-completion\completions\python
c:\Users\Fowler\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\usr\share\bash-completion\helpers\python
c:\Users\Fowler\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\usr\share\sosreport\sos\plugins\python.py
c:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\aniso8601\builders\python.py
c:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\_pytest\python.py
c:\Users\Fowler\Documents\vscodeProjects\playarea\.venv\Scripts\python.exe
c:\Windows\Installer\$PatchCache$\Managed\8B9C64EBE8DD53846B6846E46A14F5EE\3.7.2150\python.exe
c:\Windows\Installer\$PatchCache$\Managed\9CB0624238F6F8F469EAD6566412DD7F\3.7.2150\python.exe
PS C:\Users\Fowler> where.exe /r c:\ pytest
c:\Users\Fowler\AppData\Roaming\Python\Python38\Scripts\pytest.exe
c:\Users\Fowler\AppData\Roaming\Python\Python38\site-packages\pytest.py
And finally! Whew, in case this sheds any light, here is a picture showing the python process having fun eating up my CPU during pytest.py...
I would be oh, so grateful for any assistance or thoughts!
Fixed.
The answer appears to be
Uninstall python via the windows apps and features
Remove the c:\program files\python38 directory
Remove the ..\AppData\Roaming\Python directory
Reinstall
Not sure what the "root" problem was, but a total wipe of python fixed it. Note that the python windows installer does not remove enough python stuff.
Thank you #nneonneo for getting me thinking in the right direction.
You can just run pytest from priviledged (admin) cmd for the first time. For me the issue was fixed and pytest runs from ordinary cmd now without hanging.
I have the similar problem
after i install pytest-cov or allure-pytest, pytest will hang
if i uninstall them , everything is back to normal
I have tried to install different pytest version, It didn't help
but, I tried the method you provide(uninstall python, remove the diretories), it works~, great!
but, when I install allure-pytest again, it fails again.
finally, I found that, I can't install package in privilege cmd window
If I install them in privilege cmd windows, it will make pytest hang!
so, if anyone encounter the problem I have, you can try my way.
In my case, the package anyio, a dependency of JupyterLab, was causing this problem. It was installed at the administrator level. I uninstalled it and reinstalled at the user level and pytest started working again.
Using Ubuntu 18.04/20.04 + Python 3.8.2
My tests were hanging in a similar matter after showing results.
Removing pytest-cov didn't help.
What helped was moving from Python 3.8.2 to a newer version (like 3.8.12)
I ran into the same issue. In my case my IDE didn't load the correct conda environment. So make sure you're in the right environment for your application and use conda activate myEnv to change it if necessary.

Conda working but could not create virtual environment

I'm having problems setting up a virtual environment with Conda. Conda is working (I guess) when I tried commands such as conda --version.
But when I tried conda create -n mynewenv python=2.7 I got an error below.
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1003, in __call__
return func(*args, **kwargs)
File "/opt/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 74, in _main
from ..base.context import context
File "/opt/anaconda3/lib/python3.6/site-packages/conda/base/context.py", line 30, in <module>
from ..common._os.linux import linux_get_libc_version
ModuleNotFoundError: No module named 'conda.common._os.linux'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/anaconda3/bin/conda", line 13, in <module>
sys.exit(main())
File "/opt/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 150, in main
return conda_exception_handler(_main, *args, **kwargs)
File "/opt/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1291, in conda_exception_handler
return_value = exception_handler(func, *args, **kwargs)
File "/opt/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1006, in __call__
return self.handle_exception(exc_val, exc_tb)
File "/opt/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1050, in handle_exception
return self.handle_unexpected_exception(exc_val, exc_tb)
File "/opt/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1061, in handle_unexpected_exception
self.print_unexpected_error_report(error_report)
File "/opt/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1116, in print_unexpected_error_report
from .base.context import context
File "/opt/anaconda3/lib/python3.6/site-packages/conda/base/context.py", line 30, in <module>
from ..common._os.linux import linux_get_libc_version
ModuleNotFoundError: No module named 'conda.common._os.linux'
I tried and search online for errors involving the said module conda.common._os.linux but could not find any. I would like to know where can I get this module or should I reconfigure conda? The server is currently using Python 3.6.7 and Conda 4.6.14.
UPDATE
Apparently conda is not working. I get the same error message with any other conda arguments such as info and list. The only working arguments are -h and -V to check help message and version check. How can I reconfigure conda? This is on a shared server.

Arcgis Pro 2.0 Jupyter Notebook Install Fails

I did a fresh windows install of ArcGIS Pro 2.0 to a local user location. I then used the python package installer to install spyder and jupyter.
I launched jupyter notebook from the python command prompt that resides in the start menu for ArcGIS Pro.
Jupyter launches, but creating a new notebook always starts with a dead kernel. ipykernel is installed according to the ArcGIS pro python package manager. The kernel error message follows.
Traceback (most recent call last):
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\notebook\base\handlers.py", line 516, in wrapper
result = yield gen.maybe_future(method(self, *args, **kwargs))
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "<string>", line 4, in raise_exc_info
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\gen.py", line 1063, in run
yielded = self.gen.throw(*exc_info)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\notebook\services\sessions\handlers.py", line 75, in post
type=mtype))
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "<string>", line 4, in raise_exc_info
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\gen.py", line 1063, in run
yielded = self.gen.throw(*exc_info)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 79, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "<string>", line 4, in raise_exc_info
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\gen.py", line 1063, in run
yielded = self.gen.throw(*exc_info)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 92, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "<string>", line 4, in raise_exc_info
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\tornado\gen.py", line 307, in wrapper
yielded = next(result)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 94, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\jupyter_client\manager.py", line 257, in start_kernel
**kw)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\jupyter_client\manager.py", line 203, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\jupyter_client\launcher.py", line 128, in launch_kernel
proc = Popen(cmd, **kwargs)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\subprocess.py", line 676, in __init__
restore_signals, start_new_session)
File "C:\Users\rdchlbms\AppData\Local\Programs\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\subprocess.py", line 957, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
I've worked on this problem for a few days but I can't figure it out. I've looked at a number of posts that discuss connecting Jupyter and arcgis. They all make it appear possible if not easy, but this seems like a non-starter. What is missing, and why is the kernel starting dead? How do I fix it?
you said it's dead kernel though python is installed , assuming everything ok (versions, etc) ,that's means jupyter didn't recognize the kernel yet
The error is matching that of: issue
I think it's mostly the same , sometimes the kernels json files for jupyter need to be created in some folder (in windows it were in C:/Programs Data/Jupyter/.. ) before the first usage
launch the command (as admin):
python -m Jupyter kernelspec install-self
Then retry,
To fix it, run the python command prompt with the following:
(gee) C:\Users\thapa\AppData\Local\ESRI\conda\envs\gee>
conda activate tensorflow1
conda install ipykernel
ipython kernel install --name tensorflow1 --user
Restart ArcGIS pro, now it will work.

Error "%1 is not a valid Win32 application" when starting IPython Notebook (Anaconda 3)

How it all started...
I've installed Python 3 first (on Windows 8.1) to learn Python. Later, I took a Python bootcamp where they told me to install Anaconda, so I did. I later learned that this was Python 2, so I downloaded and installed Anaconda 3 which has Python 3.
By now things are redundant and confusing to know the packages that are installed. So I decided today to uninstall all Pythons (i.e. standalone Python 3, Anaconda, and Anaconda 3). I googled for instructions, and it seemed that all I needed to do was uninstall via the 'Programs and Features' in the control panel.
Now, I re-installed Anaconda 3, and I was able to run a .py file from cmd and in PyCharm.
Problem:
When I try starting IPython Notebook (I understand this is part of the Anaconda distribution), it gives me the following error message,
PS C:\Users\myPC> ipython notebook
Traceback (most recent call last):
File "C:\Users\myPC\Anaconda3\Scripts\ipython-script.py", line 5, in <module>
sys.exit(start_ipython())
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\__init__.py", line 120, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 573, in launch_instance
app.initialize(argv)
File "<string>", line 2, in initialize
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 75, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\terminal\ipapp.py", line 321, in initialize
super(TerminalIPythonApp, self).initialize(argv)
File "<string>", line 2, in initialize
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 75, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\core\application.py", line 369, in initialize
self.parse_command_line(argv)
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\terminal\ipapp.py", line 316, in parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv)
File "<string>", line 2, in parse_command_line
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 75, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 471, in parse_command_line
return self.initialize_subcommand(subc, subargv)
File "<string>", line 2, in initialize_subcommand
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 75, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\config\application.py", line 402, in initialize_subcommand
subapp = import_item(subapp)
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\utils\importstring.py", line 42, in import_item
module = __import__(package, fromlist=[obj])
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\html\notebookapp.py", line 30, in <module>
check_for_zmq('13', 'IPython.html')
File "C:\Users\myPC\Anaconda3\lib\site-packages\IPython\utils\zmqrelated.py", line 10, in check_for_zmq
import zmq
File "C:\Users\myPC\AppData\Roaming\Python\Python34\site-packages\zmq\__init__.py", line 42, in <module>
_libsodium = ctypes.cdll.LoadLibrary(bundled_sodium[0])
File "C:\Users\myPC\Anaconda3\lib\ctypes\__init__.py", line 429, in LoadLibrary
return self._dlltype(name)
File "C:\Users\myPC\Anaconda3\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
I searched for this error message and was able to find some posting by others getting similar errors, but for different situations unrelated to starting IPython Notebook. I tried some of the suggested solutions in these, but none seem to help me getting IPython Notebook started.
At this point, I'm afraid that I may just completely mess this up even further...
How can I can fix this problem?
I got IPython Notebook back. I'm not really sure what's happening behind the scene, but this is what I did.
Uninstalled Anaconda 3
Re-installed Anaconda 3 (just to see if
something had gone wrong in the previous re-installation.
Needless to say, I still couldn't start IPython Notebook)
Installed Anaconda 3 (this time, 32-bit; previously I had been
dealing with the 64-bit Anaconda 3)
I was able to start IPython Notebook from cmd
For some reason, I have a bad feeling that I may still have left the problem somewhere unresolved; and may come back to bite in the future. If anyone has any suggestions on what to look into (e.g. cleanup), I would really appreciate it!

Categories