9

Issue: I get fatal error when I run jupyter notebook in cmd.exe as administratortor

  • in: python -m pip install jupyter
  • out: success
  • in: jupyter notebook
  • out: Fatal error in launcher: Unable to create process using '"'

I've tried the following, but I get same fatal error when I try to launch jupyter notebook from cmd

Environment

  • Windows 10 Pro 64-bit version 1709 build 16299.125
  • Python 3.6.4 (see sys paths in screen shot below)

screen shot of error https://www.dropbox.com/s/ai0ualjfj87uaaq/python_issue_20180127.png?dl=0

docs used:

E_net4
  • 27,810
  • 13
  • 101
  • 139
Webby
  • 337
  • 1
  • 3
  • 10

13 Answers13

11

What worked for me was the command python -m notebook - I did not have Anaconda installed

Hari5000
  • 371
  • 2
  • 10
  • This worked for me. The issue was that jupyter & python were installed via a package installer, as part of a deployable App. The "jupyter.exe" launcher, as found in the .\python\Scripts folder, is a compiled shortcut that uses a hardcoded path to define the python location. This happens to be the path used in the docker container in which the App installer package was built. Using `python -m notebook` executed the notebook portion without the jupyter.exe being needed – RexBarker May 02 '21 at 21:26
  • With 'python -m notebook' i can't save the jupyter session, i get "Cannot rename file or directory 'Untitled.ipynb'" – Shevach Riabtsev Feb 25 '23 at 14:21
5

I believe you need to open Jupyter notebooks by typing jupyter notebook in the anaconda prompt, not the regular windows command prompt.

briancaffey
  • 2,339
  • 6
  • 34
  • 62
  • 2
    Thank you. It worked after I ran following in cmd.exe `%windir%\System32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3` then ran `jupyter notebook` and jupyter notebook launched. Interesting thing is now jupyter notebook launches directly from cmd.exe – Webby Jan 27 '18 at 20:53
  • 3
    I tried doing so, it works OK but I need to run this command every time I try to launch Jupyter. Also, I can't import some packages like plotly (installed from anaconda) and missingno (installed from pip). Is there a way to truly solve the problem? – Clément F Feb 02 '18 at 13:25
  • 1
    @Clément F - problem was completely solved after I ran activate.bat and added anaconda to PATH on my windows 10 machine `setx PATH "%PATH%;C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Scripts;" ` – Webby May 16 '18 at 00:57
5

For Windows users that have anaconda installed, try on Windows CMD/Powershell (better if you run it as admin):

(Assuming your environment is named "root")

activate root
jupyter notebook

Hope that helps

EduGord
  • 139
  • 2
  • 13
3

I know this sounds strange ... But I ran:

python -m pip install jupyter

I did this inside my Anaconda (which I shouldn't have to do) and it installed jupyter... fixed the issue for me

ProsperousHeart
  • 188
  • 1
  • 14
  • thanks this fixed my issue. could you tell me a way to avoid adding python -m prefix? – Gopi P Jun 08 '23 at 07:32
  • 1
    @gopi-p I wish I knew. On one machine I seem to be forced to do it that way and on another I'm not. Environment variables appear the same. So I'm not sure - sorry! – ProsperousHeart Aug 23 '23 at 03:56
3

In my case, There was one redundant path of python3 added in the environment variable already and I was adding again. I just removed that path and run jupyter notebook through command prompt and it worked perfectly.

Yashi Aggarwal
  • 407
  • 2
  • 6
1

Had the same problem what I did was

pip install jupyter

and then, just went ahead and typed

jupyter notebook

works like magic now

siyunlee
  • 19
  • 1
  • 5
  • You only need to pip install jupyter, the "notebook" will be ignored.. Don't see how this will solve OP's problem – StupidWolf Nov 05 '21 at 12:35
  • Aha. I had the same problem, and I did this, then it worked. So that's why I wrote this. That's how it's going to solve OP's problem? Anyways thanks for the feedback. I will edit this! – siyunlee Nov 05 '21 at 12:59
0

These command in cmd works:

activate root
jupyter notebook

The second command to open jupyter notebook is : jupyter-notebook-script.py

I basically try to open notebooks with jupyter lab so what I have done is the following:

  1. 1.Right-click on any notebook select "open with" then select "choose another app"
    1. Now select "look for another app in pc"
    2. Go to the directory where your Anaconda Scripts are present. For me it's C:\ProgramData\Anaconda3\Scripts
    3. Select "jupyter-notebook.exe" or "jupyter-lab.exe"

Now every notebook will open automatically just by hitting enter and no need to type the command again and again

0

For those ones who do not have anaconda

python -m jupyter notebook

Alibek Jakupov
  • 620
  • 6
  • 14
0

I was using the Python37 installation from the Microsoft store, when I suddenly got the 'Fatal error in launcher: Unable to create process' error while trying to start the jupyter notebook. I actually tried every answer here, but with no succees.

The solution was to completely uninstall/delete everything Python/Jupyter related from AppData as well as the leftovers from my preceeding Anaconda installation and then go for a clean install from python.org.

I guess this is something we all have to do from time to time.

Peter
  • 10,959
  • 2
  • 30
  • 47
  • Seems like Microsoft were responsible for whatever happened to my Jupyter install, too. The only change I've made is installing Visual Studio Community and uninstalling Visual Studio Professional. – Denziloe Dec 03 '19 at 12:14
0

Check in to your Environment Variable Paths. If you had installed both Python(Python 2.x.x) or Python3(Python 3.x.x) you will have a problem running Scripts file of python, since you had duplicated install. Uninstall the redundant one.

If you had tried to fix it multiple times and nothing works, try re-install your Python. This save lives every time.

Sauer Voussoir
  • 111
  • 2
  • 12
0

This problem is caused by your antivirus program because I suffered from the same issue, then I discovered that my antivirus software that I am using which is Avast was blocking python.exe file for some reasons that I do not understand. So you should go to your antivirus settings and make an exception for python.exe file to unblock it.

0

Had the same problem and tried every suggestion here and in other forums.

In the end, removing the environment via conda remove and then creating it again worked. But I had to update conda via

conda update -n base -c defaults conda

and then start the notebook via jupyter notebook

Leonidas
  • 21
  • 1
0

I resolved this problem on Windows by running the Anaconda Prompt as Administrator, and then launching JupyterLab. Launching JupyterLab from the Anaconda Prompt with elevated privileges seems to have solved the issue entirely.

matteblack
  • 85
  • 5