I am getting “cannot import name ‘np’ from ‘mxnet’”

Python Version: 3.7
MXNet Version: mxnet-cu100 1.5.1.post0

1 Like

Hi. When I tried to download the code from the link But it seems to be that file was damaged. I downloaded it in win 10. Does anyone knows why?

Hi. I’m getting the following error even after installing everything that was mentioned in the tutorial.

ImportError** : cannot import name ‘np’ from ‘mxnet’

I use Windows.

Hi @YashwanthAllakky, thanks for the feedback. Here are several quick inspections:

  1. Did you activate the environment? For example,

conda activate d2l


source activate d2l

  1. Have you tried the following:

pip install -U --pre mxnet

  1. If the above still doesn’t work, please uninstall mxnet and reinstall it.
1 Like

Hi everyone, I need help with installation of d2l environment in cuda mode. I have Win 7 PC and followed all installation instructions to the letter (so no deviations, as far as I know). The problem is that I have python consistently crashing at least in some notebooks (e.g., rnn-gluon.ipynb) with an exception code 40000015, complaining about ucrtbase.dll
Not sure if it is related, but just before crashing I also always recieve a warning about some potential incompatibility of cudnn.dll (see a snapshot).

I’ve tried different sub-versions of cudnn10.1 (including 7.5.0, 7.6.0) with no difference. My GPU card is RXT 2060 with Cuda 10.1.243.
Also I can run notebooks with no issues in CPU mode though (i.e. with mxnet==1.6.0b20190926, instead of mxnet-cu101==1.6.0b20190926, of course uninstalling the other mxnet first).
Any suggestions or ideas would be very welcome.
Many thanks!

P.S. Overall this interactive book is a great idea, so really looking forward to going through all of it at least in CPU mode, if not GPU.

using ubuntu 18.04 and successfully running conda env. Installed python, pip, mxnet, d2l, and jupyter notebook as per instructions. when I run a block of code in the notebook I get error:

“The kernel appears to have died. It will restart automatically.”

running python in command line gives

import numpy
import mxnet as mx
Illegal instruction (core dumped)

…so i believe my issue is with the mxnet download? Any direction would be great! Have enjoyed reading the book thus far.

have anyone installed d2l and mxnet in google colab?
when i do !pip install d2l mxnet, i see this following warning after installation; So i reset my runtime and then it never re-connects.

And when i connect to a runtime again, and i would then have to start with pip installation command again and the issue repeats. how do i solve this?

Hi @jdpeiffer6, last time I have this issue I reinstall conda and jupyter. Maybe this link can help:

Let me know whether it works?!

I think it would be useful to also add instructions to starting this up in SageMaker studio. Would make for a 2-click setup almost.

I followed the steps in the installation section on my windows PC. When I run any of the chapters in Jupyter notebook, the links to other sections of the book do not work. For example, the main index notebook looks like this:

Any tips on how to fix this would be appreciated. Thanks!