Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
189 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...