jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.68k stars 4.92k forks source link

Kernel dying when importing numpy #5614

Open curtiss01 opened 4 years ago

curtiss01 commented 4 years ago

I've just started the Udemy "Learning Python for Data Analysis and Visualisation" course and did not appreciate it would be using Python 2.7.

I have python 3.7 installed and used the pip3 install method on a mac terminal to install numpy. However, in the first lecture, the first step is to run a line of code: import numpy as np. When I run this, I get an asterisk in the input, the kernel dies and a message pops up saying "The kernel appears to have died. It will restart automatically.".

I'm not sure if this is an issue with how I've installed numpy, or whether it's because I'm using the wrong version of python - as you can tell I'm very new to this!

Any help would be appreciated!

kevin-bates commented 4 years ago

You'll need to provide the output of the notebook console. Yes, there's probably something amiss with your numpy installation. If you haven't done so, make sure you've also installed jupyter in your 3.7 env and run it from there as well. Also, please verify the import statement succeeds using the python REPL prior.

Tejasvigupta commented 4 years ago

Hi, try uninstalling it using pip3 uninstall numpy , and then you can either try installing it in your anaconda navigator or you can instead directly open Jupyter notebook and install there and use it.

zainulabidin302 commented 3 years ago

I experienced a similar problem. On Windows, I had a running job that was holding GPU. When the job ended, the problem vanished.

mdavis-xyz commented 3 months ago

I had a similar error. Uninstalling and reinstalling numpy fixed it. (It was version 2.0.0 both before and after.)

When the issue was occurring, I was able to get the error in a plain terminal interpreter session outside of Jupyter.

When I tried to reproduce the issue from scratch (Python 3.11.4, clean venv, pip install pandas polars duckdb jupyterlab, python3 -c 'import numpy') I didn't get the error. So it's not a reproducable error.