Python中的无效语法-m pip install(...)尝试了所有内容[重复]

问题描述 投票:0回答:1

这个问题在这里已有答案:

我知道有这样的帖子,但我找不到答案:S

我安装了最后一个版本的Python(3.7),它已经带有pip吧?我试图在CMD上尝试安装库,但每次我都得到“无效语法”。

py -m pip install ndjson;  
python -m pip install ndjson;  
pip install ndjson;  
python.exe -m pip install ndjson;  

甚至python --version语法无效。

谁来帮帮我?

我的窗户是64位..

编辑:

enter image description here

python pip
1个回答
1
投票

你在Python解释器而不是终端。

打开一个新终端并再次尝试pip install ndjson

您知道,如果您在终端的开头看到>>>,那么您就是Python解释器。你不能从Python解释器运行pip命令;你只能从终端运行它们。

要退出解释器,您可以键入quit()(或在某些系统中点击控制D),这将返回到您的终端。

© www.soinside.com 2019 - 2024. All rights reserved.