简体   繁体   English

pip 出现问题,无法从 cmd 安装模块

[英]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.尝试为某些网络摄像头安装 opencv,以后会弄乱覆盆子。

If you are on Windows you have just to type py -m pip install opencv-python .如果您在 Windows 上,您只需键入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:如果您使用的是 Linux 发行版,您应该首先安装python-pippython3-pip (通过您的 package 管理器),然后输入:

  • pip (or pip3) install opencv-python (if you want to install it locally). pip (or pip3) install opencv-python (如果你想在本地安装)。
  • sudo pip (or pip3) install opencv-python (if you want to install it globally). sudo pip (or pip3) install opencv-python (如果你想全局安装)。

You can find more information here .您可以在此处找到更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM