Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
187 views
in Technique[技术] by (71.8m points)

python - Problem with pip, cant install modules from cmd

I just get a syntax error. I've tried these commands:

pip install opencv-python 
pip3 install opencv-python 
python -m pip install opencv-python 

All of these just give me a syntax error.

Trying to install opencv for some webcams, going to be messing with raspberry later.

question from:https://stackoverflow.com/questions/65918742/problem-with-pip-cant-install-modules-from-cmd

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you are on Windows you have just to type py -m pip install opencv-python.

If you are on a Linux distribution you should firstly install python-pip or python3-pip (via your package manager) and then type:

  • pip (or pip3) install opencv-python (if you want to install it locally).
  • sudo pip (or pip3) install opencv-python (if you want to install it globally).

You can find more information here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...