No module named 'numpy'

I am working on Nvidia Geforce RTX 3050 with Windows 11 preinstalled and Ubuntu 22.04 LTS installed as WSL2.
I have followed the instructions in https://learn.microsoft.com/en-us/windows/ai/directml/gpu-tensorflow-plugin

I have created an env tfdml_plugin as per the instructions of the above link.
I have installed jupyter notebook and numpy
conda list gives the following output:

jupyter_client               7.4.9
jupyter_core                 5.3.0

numpy                        1.24.3

Now when I run jupyter notebook and in that rum:
import numpy

This returns the error:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import numpy as np

ModuleNotFoundError: No module named 'numpy'

When i type like this:

type(tfdml_plugin) xxxx@xxxx :~$ python
Python 3.10.11 (main, Apr 20 2023, 19:02:41) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> a=numpy.array([1,2,3])
>>> print(a)
[1 2 3]

there is no error?
why is this occuring like this?

Hi Rensisam,
I believe that you have not install numpy yet. Could you please follow this step to activate your virtual environment first
Step 1: source venv/bin/activate (Mac Os)
or in Windows source venv/Scripts/activate
Step 2: pip install numpy
Step 3: you can reload your jupiternote book by shut it off and on>
Hope it works well for you

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.