why Installed module in python throws error

116 Views Asked by At

I installed cntk module in my system but whenever I try to run a code it says no module found

import cntk as C
ModuleNotFoundError: No module named 'cntk'
1

There are 1 best solutions below

0
Niko Fohr On

This is very simple problem. You do not have cntk installed*. The answer is same in any "No module named X" questions.

1) Check your python interpreter

inside the same script that throws the error, run

import sys
print(sys.executable)

It prints, for example C:\Python\Python 3.8.6\python.exe. Let's call this <path_to_python>.

2) Install the package with the correct interpreter

Instead of

pip install cntk

run, (in case or regular Python installation)

"<path_to_python>" -m pip install cntk

or, if the <path_to_python> points to conda python, you need to activate that conda environment and

conda install cntk

or install with

conda install -n <name_of_env> cntk

* You might have it installed to different python folder/virtual environment.