anacondacondajupyter-lab

How to solve [WinError 5] Access is denied in anaconda prompt


I have reset my laptop and installed Anaconda in it, and I tried to open JupyterLab but it gives me error

Error executing Jupyter command 'lab': [WinError 5] Access is denied 

but it works fine when I try to open JUPYTER NOTEBOOK or try to open JUPYTER LAB with Anaconda as administrator.

I reinstalled Anaconda, and still it gives me the same error. Also it gives me the same error when I try to open JUPYTER LAB from Anaconda Navigator. Before resting my laptop it works fine for me, but now it's not.

I want to run JUPYTER LAB with normal Anaconda prompt

Additional details


Solution

  • Workaround:

    1. open anaconda navigator
    2. click on the jupyter lab settings option and then remove it
    3. Now open your anaconda prompt and type the following command: conda install -c conda-forge jupyterlab

    now try to open it.

    Proper solution:

    If you have installed Anaconda for all users then you will face this issue (thanks to Alok Rajasukumaran, who pointed out this). The best way to solve this problem would be to reinstall this for only the current user.

    But if you have a requirement to install for all users, then you can follow these steps:

    1. run the terminal as an administrator
    2. type jupyter lab

    Optional (Automating launching jupyter lab with shortcut)

    If you want to automate these steps, then you can create a batch file and assign a keyboard shortcut to it. Steps are as follows:

    1. open notepad and write "jupyter lab" and save it as a .bat file
    2. right-click on that file and click on create shortcut.
    3. now open the properties of created shortcut file and in the "shortcut-key" section type any combination of keys you want to set shortcut.
    4. click on "Advanced" and select "Run as administrator"

    Now you can initiate jupyter lab directly by typing your shortcut key and giving "yes" permission to the prompt.

    enter image description here