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

You can just run it with Python:

python -m jupyterlab

This should work from an Anaconda Prompt or even the command prompt (if it uses the Python in Anaconda). It does not require admin rights.


Usually, you don't have error in opening jupyter notebook command.

I usually type the jupyter notebook in the path bar in the explorer to open the notebook from that path directly — but as we are having an error in jupyter lab, I was only able to open jupyter notebook from there.

The solution for that is:

  1. Just type jupyter notebook as usual in the command prompt or the path bar in explorer.

  2. As soon as the browser opens automatically, change the URL from:

http://localhost:8888/tree to → http://localhost:8888/lab

  1. Yes, just a one word change. treelab and... Whoo! The jupyter lab is open right there you want it to be!

Try to execute as an admin. Problem solved.

This solution is unsafe. When you execute a program with Admin this program has full permissions over the system.

The good solution is to create a new environment with your current system user (not root/admin). Activate this new environment and it would works


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