苹果m1在jupyter notebook执行from d2l import torch时,每次都会内核死亡

impot d2l 是可以,但是from d2l import torch 就不行

Hey I translated your question to english and as far as I understood you have a problem to run the import statement. I had the same issue make sure that you install miniconda and create & activate the environment as described.

In my case the problem was that I did not use the correct python despite having activated the environment. Running ‘which python’ should return the python of your d2l environment. This github discussion led to the solution to me.

‘… Now, this doesn’t occur if the .bashrc entries for Anaconda and pyenv are swapped:…’

So I swapped the entries and then I had the correct python version.