Use pip to install SpeechRecognition under Linux
You will often see statements like import speechrecognition as sr
in the code. To check the relevant information, you need to use pip to install SpeechRecognition. . First install pip under Linux, and then install it through the command pip install SpeechRecognition
. There will always be a large section of red text (roughly meaning network timeout when connecting to a third-party library). The content of the red text is roughly as follows:
I checked a lot of information online, and some said it was a change. Just change the capitalization of the letters and then restore them to the previous ones. I tested it and it didn’t work! ! !
After searching for a long time, I finally found the solution! ! ! !
Solution:
pip specifies the installation source for installation: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple SpeechRecognition
Effective in actual testing:
The above is the detailed content of How to solve the connection timeout when using pip to install SpeechRecognition under Linux. For more information, please follow other related articles on the PHP Chinese website!