0

I am learning Python from the Internet. I have downloaded Python 3.6 and Spyder from Anaconda. Using Windows 10 device. 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. I need to open the python terminal.

3
  • 1
    To install a package, you should use pip install or conda install since you've had Anaconda installed. Commented Sep 2, 2018 at 3:08
  • BTW are you trying to open the Python terminal or Spyder? Neither pip nor conda commands is executed in Python. Commented Sep 2, 2018 at 3:11
  • @ytu that depends on the version of pip Commented Sep 2, 2018 at 6:00

3 Answers 3

1

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. Then you can type

  python 

at the prompt, and it will start the default Python you've installed for Anaconda

Sign up to request clarification or add additional context in comments.

Comments

1

Press WIN + R, then type cmd and press ENTER.

Type in the following command and press ENTER and the installation will began.

pip install SpeechRecognition

If you have a virtual environment set up, however, execute source activate {environemt_name} before running the above command.

Type python and press ENTER to open Python Terminal.

7 Comments

he's using anaconda
@Schalton I'm using anaconda, too. Conda is compatible with pip.
Ahh, I've never ONLY had anaconda installed (I've had it with Python too) pip doesn't install to my conda dir - good to know It's worth noting part of conda's goal seems to be to enforce the use of venvs, pip from the cmd clashes with this goal a bit
In my experience, if you want pip to install packages into the conda dir, you need to source activate the conda env first.
First, source activate the conda env. Then make sure you have python and pip installed inside the env. Then do your normal pip installs inside the env. All the packages whether installed using pip or conda are all installed inside the env now.
|
0

As others have said, you should install in the cmd prompt.

There is an option to install in your IDE (Spyder)

You can run the following:

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

1 Comment

It shows attribute error: module pip has no attribute main

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.