Resolving version conflicts during the installation of Python SDK
When you install the yandex-speechkit package, the grpcio-tools version 1.46.3 is installed along with it. If you installed grpcio-tools before (e.g., when going through examples of working with the SpeechKit API), a conflict between the package versions may occur.
Check which version of grpcio-tools you have installed:
pip list | grep grpcio-tools
If the command output contains the grpcio-tools package and its version is higher than 1.46.3, create a virtual environment to avoid a version conflict. Or else, install the yandex-speechkit package with no virtual environment.
To deploy a virtual environment and install the package in it:
-
Create a directory for your Python SDK project and open it.
-
Create a virtual environment in this directory:
python3 -m venv <environment_name>If you need to create an environment using a specific Python version, specify
python<version>instead ofpython3, e.g.,python3.9. -
Activate the environment.
source <environment_name>/bin/activateYou will see the environment name before the input line in the terminal.
-
Install the
yandex-speechkitpackage using the pip package manager:pip install yandex-speechkit
Continue working with the Python SDK in the deployed environment. When you are finished, exit the environment by running the deactivate command.