简体   繁体   English

如何打开Python终端?

[英]How to open Python Terminal?

I am learning Python from the Internet. 我正在从互联网上学习Python。 I have downloaded Python 3.6 and Spyder from Anaconda. 我已经从Anaconda下载了Python 3.6和Spyder。 Using Windows 10 device. 使用Windows 10设备。 I need to install speech recognition library, using code: 我需要使用代码安装语音识别库:

sudo pip SpeechRecognition

and for that I am not able to use Spyder.It shows a syntax error. 因此我无法使用Spyder,它显示语法错误。 I need to open the python terminal . 我需要打开python终端

Go in the Start Menu, and look for the "Anaconda3" item, and use the Anaconda Prompt item there to launch a shell session with the environment set up. 在“开始”菜单中,找到“ Anaconda3”项,然后在该处使用Anaconda Prompt项以设置环境启动Shell会话。 Then you can type 然后你可以输入

  python 

at the prompt, and it will start the default Python you've installed for Anaconda 在提示时,它将启动您为Anaconda安装的默认Python

Press WIN + R , then type cmd and press ENTER . WIN + R ,然后键入cmd ,然后按ENTER

Type in the following command and press ENTER and the installation will began. 输入以下命令,然后按ENTER ,安装将开始。

pip install SpeechRecognition

If you have a virtual environment set up, however, execute source activate {environemt_name} before running the above command. 但是,如果设置了虚拟环境 ,请在运行上述命令之前执行source activate {environemt_name}

Type python and press ENTER to open Python Terminal. 键入python并按ENTER打开Python Terminal。

As others have said, you should install in the cmd prompt. 正如其他人所说,您应该在cmd提示符下安装。

There is an option to install in your IDE (Spyder) 有一个选项可以安装在您的IDE(Spyder)中

You can run the following: 您可以运行以下命令:

import pip
pip.main(["install", "SpeechRecognition"])

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

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