# Error while running 'jupyter-lab' or 'jupyter lab' on Windows machine

**URL:** <https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341>\
**Category:** JupyterLab\
**Created:** [August 11, 2021, 7:55am UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341 "2021-08-11T07:55:52Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![itsdebartha](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/itsdebartha/32/4849_2.png) [@itsdebartha](https://discourse.jupyter.org/u/itsdebartha)\
**Post date:** [August 11, 2021, 7:55am UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/1 "2021-08-11T07:55:52Z")

</div>

As mentioned in [this](https://jupyter.org/install) link about how to install `Jupyterlab` with `pip`, I ran into some problems. The installation went fine as far as my command prompt is concerned. But when I try to run Jupyterlab using the command `jupyter lab` the following error message shows up:

> ‘jupyter-lab’ is not recognized as an internal or external command,  
> operable program or batch file.

![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/8/87b2818218ada9c0d61b86c80c22bb99fb95e942.png)

I don’t know what is happening and some help will be really appreciated.

Note: In the above link, there’s written:

> If installing using `pip install --user`, you must add the user-level `bin` directory to your `PATH` environment variable in order to launch `jupyter lab`.

Is this a possible reason I am running into such an error? If so, can someone help me out as to how to add my user-level `bin` directory to my `PATH` environment variable?  
I am in Windows (version 10.0.19043 N/A Build 19043) with an x64-based PC

Note: I tried to install Jupyter notebook using the guide provided in the above link (`pip install notebook`), it installed fine, but while trying to run the notebook using `jupyter notebook`, I ran into the same problem (`'jupyter' is not recognized as an internal or external command, operable program or batch file.`). But this post [here](https://stackoverflow.com/a/43239824/8484779) solved this problem.

However, I could not solve the problem for `JupyterLab`.

Note: As mentioned by @fomightez in his comment below, I tried using the command `jupyter lab` but it still showed

> ‘jupyter’ is not recognized as an internal or external command,  
> operable program or batch file.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/f/f8f965d661c6a91614adfab535c00504f38fa0d1.png)

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [August 11, 2021, 3:54pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/2 "2021-08-11T15:54:45Z")

</div>

First, did you try the following command to start JupyterLab?

```bash
jupyter lab

```

That has always been the command I’ve used and is consistent with [the official JupyterLab docs on starting JupyterLab](https://jupyterlab.readthedocs.io/en/stable/getting_started/starting.html#starting-jupyterlab) and [here](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html).

---

<div class="post-metadata">

**Author:** ![itsdebartha](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/itsdebartha/32/4849_2.png) [@itsdebartha](https://discourse.jupyter.org/u/itsdebartha)\
**Post date:** [August 11, 2021, 3:57pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/3 "2021-08-11T15:57:16Z")

</div>

@fomightez yes, I tried to run using that command only. My bad, I wrote the command wrong here. I’m correcting it…

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [August 11, 2021, 4:01pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/4 "2021-08-11T16:01:41Z")

</div>

No, you didn’t write the command wrong. Your _original_ image shows you tried what the page linked to says to use. However, I’m not aware of that being the command. So the inconsistency on the Jupyter page verse the JupyterLab documentation is puzzling to me even more so than things not working on Windows. However, sometimes there is more than one way to start things.

UPDATE: Given it says [here](https://stackoverflow.com/a/66938692/8508004) either `jupyter notebook` or `jupyter-notebook` works for the classic notebook, I gather `jupyter-lab` may be another way. However, I’d prefer the documentation on install and start at Jupyter and JupyterLab documentation sites be consistent so that users having problems, and those trying to help them, aren’t distracted by slight variations of commands that are probably due to flux in the choices made in nascent versions.  
Plus in [the end](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/9) it seemed helpful we had found these variants that have the dashes & that aren’t two words with spaces between them.

---

<div class="post-metadata">

**Author:** ![itsdebartha](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/itsdebartha/32/4849_2.png) [@itsdebartha](https://discourse.jupyter.org/u/itsdebartha)\
**Post date:** [August 11, 2021, 4:03pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/5 "2021-08-11T16:03:39Z")

</div>

@fomightez I tried using this command which you mentioned, it is still showing the same error.  
I think I will edit this question showing both the methods which I’ve tried so far…

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [August 11, 2021, 4:06pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/6 "2021-08-11T16:06:35Z")

</div>

Yes, but the recent screenshot you’ve now added has a warning cut off. That warning is probably why things failed.  
Plus, you should definitely add what Windows version you are doing this on.

---

<div class="post-metadata">

**Author:** ![itsdebartha](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/itsdebartha/32/4849_2.png) [@itsdebartha](https://discourse.jupyter.org/u/itsdebartha)\
**Post date:** [August 11, 2021, 4:13pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/7 "2021-08-11T16:13:52Z")

</div>

Yes, I too had the same thought, but I don’t know how to add to the PATH…

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [August 11, 2021, 4:16pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/8 "2021-08-11T16:16:40Z")

</div>

And you say in your original post you tried, the solution [here](https://stackoverflow.com/a/43239824/8508004) and it worked for the classic notebook.  
Did you try the following variations for JupyterLab?

```python
python -m jupyterlab
python -m lab
python -m jupyter-lab
python -m jupyter lab

```

The comment [there](https://stackoverflow.com/a/43239824/8508004) by Georgy has the first one but I thought maybe another typo and so was worth trying some variations?

* * *

Did you search that issue and try any of the solutions? Such as:

- [How to add Python to Windows PATH - Data to Fish](https://datatofish.com/add-python-to-windows-path/)
- [windows - The script is installed in directory, which is not PATH - Super User](https://superuser.com/questions/1372793/the-script-is-installed-in-directory-which-is-not-path)

---

<div class="post-metadata">

**Author:** ![itsdebartha](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/itsdebartha/32/4849_2.png) [@itsdebartha](https://discourse.jupyter.org/u/itsdebartha)\
**Post date:** [August 11, 2021, 4:48pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/9 "2021-08-11T16:48:50Z")

</div>

@fomightez I tried adding python to Windows PATH, by uninstalling and reinstalling python and then manually adding the `scripts` path to PATH. Finally it worked.

However, the command `jupyter lab` throws an error:

> Fatal error in launcher: Unable to create process using ‘“c:\program files\python.exe” “C:\Users\user\AppData\Roaming\Python\Python39\Scripts\jupyter.exe” lab’: The system cannot find the file specified.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/a/a6f6cb7bb10d1ac1b63a87208106708c215e4115.png)

However, if I run `jupyter-lab`, it works just fine.

Same thing happens when I try to open only the notebook(`jupyter notebook`) after installing jupyter notebook using `pip install jupyter`:

> Fatal error in launcher: Unable to create process using ‘“c:\program files\python.exe” “C:\Users\user\AppData\Roaming\Python\Python39\Scripts\jupyter.exe” notebook’: The system cannot find the file specified.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/4/463662c7da643e73fc9a799efcb65bdc3c028b20.png)

But if I run `jupyter-notebook`, works just fine again.

Seems like there is some inconsistency in the documentations.

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [August 11, 2021, 4:56pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/10 "2021-08-11T16:56:08Z")

</div>

Glad it’s working and your posts on what worked should help others troubleshoot installing via `pip` on Windows, too.

Perhaps the one with the dashes may work in Windows more reliably, while the those that are two words fail, due to the way it is handling spaces in the commands?  
I’m glad we learned to try some variants. I hadn’t been aware of those and that they may work differently on different platforms since I usually use Unix-based systems.

---

<div class="post-metadata">

**Author:** ![itsdebartha](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/itsdebartha/32/4849_2.png) [@itsdebartha](https://discourse.jupyter.org/u/itsdebartha)\
**Post date:** [August 13, 2021, 4:20pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/11 "2021-08-13T16:20:46Z")

</div>

For manually adding the scripts path to PATH, I mainly used the information at the link [How to add Python to Windows PATH - Data to Fish](https://datatofish.com/add-python-to-windows-path/).

But as a fair amount of time has passed since that page has been updated (17th July 2020) things were a bit different in terms of appearance (though the process was basically the same).

I already found out that there was a `Path` variable under my environment variables list and proceeded to `Edit` the path:  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/d/d787a277f4a83c756922d4dbb15e1e0938d74287.png)

Then I went on to add a `New` path in there:  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/f/f98589630e115e47c6b32c1f84944376be5456df.png)

In my systems drive, I searched for `Scripts` and I added the resultant path for the python Scripts folder. For my system, that came out to be:

> C:\Users\user\AppData\Roaming\Python\Python39\Scripts

Saved this, restarted my command prompt, and it works just fine.

Thanks, @fomightez again for helping me out…

---

<div class="post-metadata">

**Author:** ![afe\_ccd](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/afe_ccd/32/9189_2.png) [@afe\_ccd](https://discourse.jupyter.org/u/afe_ccd)\
**Post date:** [February 23, 2023, 3:20pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/12 "2023-02-23T15:20:16Z")

</div>

By running  
python -m jupyterlab  
instead of “jupyter lab” or “jupyter-lab” solves this problem.

Why does the official document fool us? We follow every instruction in the official website and waste our time.

---

<div class="post-metadata">

**Author:** ![BoomShakaLaka](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@BoomShakaLaka](https://discourse.jupyter.org/u/BoomShakaLaka)\
**Post date:** [August 23, 2023, 8:47am UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/13 "2023-08-23T08:47:46Z")

</div>

I love you. I would have been working at this all night if it weren’t for your comment.

---

<div class="post-metadata">

**Author:** ![brian\_o\_c](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/brian_o_c/32/13196_2.png) [@brian\_o\_c](https://discourse.jupyter.org/u/brian_o_c)\
**Post date:** [April 26, 2024, 11:20am UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/14 "2024-04-26T11:20:58Z")

</div>

Hi Folks, new here and new to python.  
having installation issues.  
I downloaded the jupyter package with the pip command, but it wont run, no matter how many versions of jupyterlab I use. ‘jupyter’ not defined.

i have added a screengrab.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/d/dc33f4f99d501036767c7299286a061b28850e27.png)

thanks and regards  
b

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [April 26, 2024, 11:56am UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/15 "2024-04-26T11:56:22Z")

</div>

@brian_o_c you are inside a Python interpreter as indicated by `>>>` prompt. You need to be in command line to start jupyterlab. To exist Python interpreter you can type `exit()` and press Enter.

---

<div class="post-metadata">

**Author:** ![brian\_o\_c](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/brian_o_c/32/13196_2.png) [@brian\_o\_c](https://discourse.jupyter.org/u/brian_o_c)\
**Post date:** [April 26, 2024, 12:09pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/16 "2024-04-26T12:09:16Z")

</div>

thanks for the reply.

lots of thinks were linked, but it is asking me what software to use to open it.  
I thought that what i just downloaded.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/a/a6ac5058a85c1e45deb79879f4e18cd7932098d9.png)

again thanks for the reply.  
b

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [April 26, 2024, 12:15pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/17 "2024-04-26T12:15:17Z")

</div>

You may want to install JupyterLab Desktop [GitHub - jupyterlab/jupyterlab-desktop: JupyterLab desktop application, based on Electron.](https://github.com/jupyterlab/jupyterlab-desktop) instead. It will give you an icon to click on.

---

<div class="post-metadata">

**Author:** ![brian\_o\_c](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/brian_o_c/32/13196_2.png) [@brian\_o\_c](https://discourse.jupyter.org/u/brian_o_c)\
**Post date:** [April 26, 2024, 12:41pm UTC](https://discourse.jupyter.org/t/error-while-running-jupyter-lab-or-jupyter-lab-on-windows-machine/10341/18 "2024-04-26T12:41:04Z")

</div>

brilliant…  
solved  
and I’m up and running.

thanks again  
b
