I am currently trying to use a combination of miniconda + jupyter (installed with pip) on a network drive and I get the following error:
pywintypes.er
For anybody having this issue, it seems to be due to updating jupyter notebook, or any other package that can update it.
The steps to fix the issue are the following,
pip install jupyter
pip install jupyter-client==5.3.1
python -m ipykernel install --user
The problem you have may be due to access rights for the browser as well as for jupyter lab to run as I have painfully just found.
My original answer can be found here: https://github.com/jupyter/jupyter_client/issues/481
But here is my story for others who want to continue to use the latest Jupyter lab/Notebook version:
(I run Anconda which comes pre installed with Jupyter):
1- When checking the environment paths by using this command: jupyter --paths I get two roaming locations one for runtime and one for data! This is because I use a corporate laptop and Windows is setup to store user data files in a roaming location on the network!
(base) C:\>jupyter --paths
config:
C:\Users\user_x\.jupyter
C:\ProgramData\Anaconda3\etc\jupyter
C:\ProgramData\jupyter
data:
\\A-FILEDATA-P\Profile\use_x\AppData\Roaming\jupyter
C:\ProgramData\Anaconda3\share\jupyter
C:\ProgramData\jupyter
runtime:
\\A-FILEDATA-P\Profile\use_x\AppData\Roaming\jupyter\runtime
(base) C:\>
2- So, I tried modifying C:\Users\user_xxx.jupyter\jupyter_notebook_config.py by adding
JUPYTER_RUNTIME_DIR = 'C:\Users\user_x\AppData\Roaming\jupyter\runtime'
but it did not work!
2- However, Big note here: I noticed that jupyter lab command fire a "stand alone" Chrome I have on a removable usb harddisk! which under the corporate Windows setup does not have any rights to write to other folder location on the laptop, thus the security error!
3- The solution was to setup two folders on my usb disk, where stand alone Chrome is found and set the environment variables to point to those locations like this:
set JUPYTER_RUNTIME_DIR=D:\jupyter\runtime
set JUPYTER_DATA_DIR=D:\jupyter
4- The only catch is that you have to do these two commands at the start of every new session as they don't persist say when you restart Jupyter lab! and as @Shongololo pointed out you can only run other programs like Spyder from the command line only for it to read the correct settings!
It remains to be found out how this could be resolved permanently.