I have put several days into sorting out the problem of conda's python virtual environments not recognizing the kernels they were build around. The problem manifests as both Spyder and Jupyter-notebook failing to start with a valid kernel. Here is an example of a conda environment built for kernel 3.8.10 specifically to run pymc3 (per pymc3 environment requirements) and how it fails in the jupyter-notebook also selected and installed specifically in that environment.
The only thing I know for sure: the error message is totally misleading. The win3api dll seems to have nothing to do with the actual problem
Does anyone recognize this? Are there tweaks that will get me going? Or is this another case of Rip-out-and-reinstall-Anaconda3? Which is a familiar refrain.
##########################
Failed to start the kernel
Unhandled error
Traceback (most recent call last):
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\tornado\web.py", line 1704, in _execute
result = await result
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\Peter\anaconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 69, in post
model = yield maybe_future(
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 762, in run
value = future.result()
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\Peter\anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 762, in run
value = future.result()
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 769, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "C:\Users\Peter\anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 100, in start_kernel_for_session
kernel_id = yield maybe_future(
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 762, in run
value = future.result()
File "C:\Users\Peter\anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 176, in start_kernel
kernel_id = await maybe_future(self.pinned_superclass.start_kernel(self, **kwargs))
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\jupyter_client\multikernelmanager.py", line 186, in start_kernel
km.start_kernel(**kwargs)
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\jupyter_client\manager.py", line 337, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\jupyter_client\manager.py", line 286, in pre_start_kernel
self.write_connection_file()
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\jupyter_client\connect.py", line 466, in write_connection_file
self.connection_file, cfg = write_connection_file(self.connection_file,
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\jupyter_client\connect.py", line 136, in write_connection_file
with secure_write(fname) as f:
File "C:\Users\Peter\anaconda3\lib\contextlib.py", line 113, in __enter__
return next(self.gen)
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\jupyter_core\paths.py", line 461, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\Peter\AppData\Roaming\Python\Python38\site-packages\jupyter_core\paths.py", line 387, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: The specified procedure could not be found.
```