Running a python script indicates that there are no modules. Where should I install them?

While running the python script(The script USES OpenCV), an error was reported as follows:
ModuleNotFoundError : No module named ‘cv2’

Hi @Alan_Wang,

Welcome to forum…

Can you explain more in detail? Can you share your xaml file… Try running the code in the IDE and check whether it is working fine?

  • As you can see, it’s just the activity of running a python script.
  • It’s okay to run other scripts, but this one can’t

The issue must be with the Python script itself. Check the import statements and make sure that all packages imported are installed on the machine.

1 Like

Can you check whether the file running in command prompt without any error?

If it is working fine, Make sure your python path is correct?

  • I want to install it, but I don’t know which directory
  • There is no problem testing with another script, not the path

Can you run this command
pip install opencv-python

Here is the documentation : opencv-python · PyPI
Change the package name in the code after installing the new package

You can do a pip install.

Run the command pip install opencv-python from command prompt.

I’m getting the same error, I had install opencv-python, still when trying to deploy ML Skill getting the below error:

Thank You

Make sure your code is running fine in the IDE or when you run it in CMD i.e., if the packages are installed locally, then it should work