Jupyter Notebook does not run in PyCharm
Asked Answered
M

14

22

When I try to run the server when I'm using PyCharm brings me this error

enter image description here

Jupyter server process exited with code 1
usage: jupyter.py [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [--debug] [subcommand]

Jupyter: Interactive Computing

positional arguments: subcommand the subcommand to launch

optional arguments:
-h, --help show this help message and exit
--version show the versions of core jupyter packages and exit
--config-dir show Jupyter config dir
--data-dir show Jupyter data dir
--runtime-dir show Jupyter runtime dir
--paths show all Jupyter paths. Add --json for machine-readable format.
--json output paths as machine-readable json
--debug output debug information about paths

Available subcommands: 1.0.0

Jupyter command jupyter-notebook not found.

When running Jupyter using VSCode it works properly.

I also tried reinstalling it from PyCharm packages and terminal but still doesn't work.

Miliary answered 30/11, 2022 at 16:36 Comment(1)
Hi, it could be one of known issues: - youtrack.jetbrains.com/issue/DS-3920/… (reproducible with WSL interpreter) - youtrack.jetbrains.com/issue/DS-4066/… (when installing jupyter-server) If it's not applicable to your case, please submit a new issue in youtrack.jetbrains.com and provide logs from Help | Collect Logs and Diagnostic Data.Prouty
M
23

I had the same issue. Just open the terminal and pip install jupyter

Madeline answered 14/3, 2023 at 2:45 Comment(2)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Occupation
Not working for me in PyCharm on Mac.Regeneracy
W
8

I didn't manage to solve this, but I found a workaround

  1. Go to PyCharm Settings and search for Jupyter Servers

  2. Open a Terminal, and start Jupyter notebook, typically: python3 -m notebook

  3. Copy the URL with the token to the Configured Server field in Pycharm, click OK

You should now be able to run and debug Jupyter cells in Pycharm!

enter image description here

enter image description here

Wary answered 7/9, 2023 at 4:33 Comment(0)
E
6

I re-installed Jupyter Notebook in PyCharm terminal with:

pip install notebook

It solve this problem in Pycharm, I hope it works for you.

Jupyter Notebook docs

Earp answered 15/6, 2023 at 10:1 Comment(3)
Not working for me in PyCharm on Mac.Regeneracy
This answer worked fine for me, solved my issue whoo who yippee yah heeDucal
I ran into this error because I installed jupeterlab, which does not install notebook. I was taking a class called Python Essential Training on linked in learning and did not realize that jupyterlab is the replacement for notebook, so it does not also install notebook (the older version of notebook server. Also I am using poetry, so the commands I used are: poetry add jupyterlab poetry add notebookSmitt
H
1

I've utilized a different approach. Navigate to the folder where your .ipynb file is located. Start your Jupyter server, use the command python3 -m notebook, for instance.

ref1

Copy the URL, specifically extracting the http://localhost:8888/tree?token= section.

Next, open PyCharm, click on Tools, then select Add Jupyter Connection. Choose Connect to Jupyter server using URL and paste your URL.

ref2 ref3

You'll be prompted for the password/Token, which corresponds to the second part of the URL following token=.... After this step, your Jupyter server should appear in your folders.

ref4

Ham answered 15/11, 2023 at 13:27 Comment(0)
G
1

1. Start Jupyter Notebook Server You can start a Jupyter Notebook server from the terminal. Open a terminal and run:

jupyter notebook

This command will start the Jupyter server and print the access URL in the terminal, usually something like http://localhost:8888. It will also display a token; you might need this to connect your Jetbrains IDE to the server.

2. Configure Jetbrains IDE In Jetbrains IDE, you need to set up the server settings to point to your local Jupyter server:

Open Jetbrains IDEand go to Preferences (or Settings on Windows/Linux). Navigate to Tools -> Python Scientific. Click on the gear icon next to the Jupyter server URL. Select Add to add a new Jupyter server. Set the server URL to the URL shown in your terminal (e.g., http://localhost:8888). You may need to add the token from your Jupyter server start-up log as part of the URL, like this: http://localhost:8888/?token=your_token_here.

In Jetbrains IDE, once you configure a Jupyter server, the settings are saved, and you typically don't need to specify the server URL each time you want to use a notebook. However, you do need to start the Jupyter server each time you restart your system or if the server was stopped for any reason

Griff answered 12/4 at 9:18 Comment(0)
D
0

I had a similar issue when I created my conda environment using the prompt in PyCharm. After some troubleshooting, I found that the best solution was to remove that environment and create a new one using the terminal instead. This solved the problem for me and allowed me to run Jupyter notebooks in PyCharm without any issues.

If you are experiencing the same problem, I recommend trying this solution. To create a new conda environment using the terminal, you can follow the steps outlined in the conda documentation.

I hope this helps you resolve the issue and get back to working with Jupyter notebooks in PyCharm.

Daniel answered 8/3, 2023 at 18:59 Comment(0)
R
0

Was able to start jupyter via terminal with python3 -m notebook.

Source: jetbrains.com/issue/DS-3120

Regeneracy answered 24/7, 2023 at 13:37 Comment(0)
I
0

I solved this problem in the following way:

  1. In Pycharm open the interpreter settings. Then in the list of installed packages, I removed all packages that mentioned word "jupyter"
  2. Created a new file ipynb, Pycharm offered to install the jupyter package. Click install - and everything works!
Ingoing answered 10/8, 2023 at 17:30 Comment(0)
P
0

Do the following in the terminal:

python3 -m notebook

Percentage answered 18/3 at 18:55 Comment(0)
D
0

This error is sometimes due to forgetting to install the Jupyter package if you are using a Jupyter server local to your PyCharm project. Open the settings >> Project: [project name] >> Python Interpreter >> click [+] button and search for the Jupyter package.

enter image description here

Diaspora answered 11/4 at 6:1 Comment(0)
B
0

I tried running on ubuntu pip install jupyterlab and python3 -m notebook. However jupyter notebook did not work for me. Got the same error.

On terminal, try running this command:

pip install --upgrade --force-reinstall --no-cache-dir jupyter

and then jupyter notebook started working!

Bourque answered 21/5 at 16:8 Comment(0)
A
0

Nothing works for me. But just this works:

pip install --upgrade charset_normalizer requests

Update charset_normalizer and requests.

Updating the packages might resolve the issue if it's caused by a bug that has been fixed in newer versions.

Avalokitesvara answered 29/5 at 10:59 Comment(0)
A
0

For me (pycharm on windows) jupyter was working fine.

Then I switched the conda environment. The new env didn't have jupyter installed, pycharm asked if I wanted to install jupyter, I hit yes.

After that, the server didn't want to start anymore (got the same error msg as in question).

In the new env I ran

pip install --upgrade --force-reinstall jupyter

from the terminal.

That fixed the issue for me.

Amando answered 18/6 at 9:55 Comment(0)
S
-1

I had to get rid of the command line arguments in settings and put server in it's place and it started working just fine.

Settings -> Languages & Frameworks -> Jupyter -> Jupyter Servers

Sowder answered 29/6 at 15:0 Comment(1)
Welcome to SO! Thanks for attempting to answer the question, but this answer is a duplicate of the answer by Ariel Lubonja.Doty

© 2022 - 2024 — McMap. All rights reserved.