Help me! A ERROR WHEN SETUP MXNET

Hi !
I am trying to run a command block using “mxnet”.
I received the red message as below. I do not know reason.
I installed “mxnet” in anaconda environment.
please help me!
thank you!

Hi,

Maybe you have installed an older version of mxnet. When I reproduce your error with mxnet 1.2.1, np and npx modules do not exist yet:

>>> import mxnet
>>> mxnet.__version__
'1.2.1'
>>> from mxnet import np, npx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'np'

When installing the latest stable version, it works:

>>> import mxnet
>>> mxnet.__version__
'1.6.0'
>>> from mxnet import np, npx
>>> npx.set_np()
>>>
1 Like

I just saw that the Anaconda mxnet (cpu) version for Windows is 1.2.1. The Anaconda mxnet for Linux and macOS are at version 1.5.0 at this moment. If you want a newer version, you can use the pip version at pypi.org.

https://anaconda.org/anaconda/mxnet

hi
Anaconda is supporting MXNET version 1.2.1 for windows, no newer version.
Do you have any other solution to run that block in Anacona environment?
thank you!

Usually it is not recommended to mix pip packages with conda packages inside the same environment. Correct dependency management is not guaranteed anymore.

Another thing you can do is create a new virtual environment inside your project folder and use pip for installing all needed packages:

python -m venv .venv
source .venv/bin/activate
pip install mxnet