[python] ModuleNotFoundError: No module named problem solved

As a Python novice, sometimes certain packages are clearly installed

pip3 install numpy
pip3 install opencv-python

and many more

But still an error:
ModuleNotFoundError: No module named

solution:

1. Global installation

 sudo -H python3 -m pip install opencv-python

Resource mirror station:

The new version of ubuntu requires the use of https source, so be careful.

Tsinghua: https://pypi.tuna.tsinghua.edu.cn/simple

Alibaba Cloud: http://mirrors.aliyun.com/pypi/simple/

University of Science and Technology of China https://pypi.mirrors.ustc.edu.cn/simple/

Huazhong University of Science and Technology: http://pypi.hustunique.com/

Shandong University of Technology: http://pypi.sdutlinux.org/

Douban: http://pypi.douban.com/simple/

 sudo -H python3 -m pip install -i https://mirrors.aliyun.com/pypi/simple opencv-python

2 How to configure environment variables

export PYTHONPATH=/Users/ibeeger/Documents/pyproject/tensorflow:$PYTHONPATH

Guess you like

Origin blog.csdn.net/uk_51/article/details/106338451