Error: "Microsoft Visual C 14.0 is required" During PyAudio Installation on Windows
When attempting to install pyaudio on Windows, users may encounter the error: "error: Microsoft Visual C 14.0 is required." This error occurs because installing pyaudio requires Microsoft Visual C 14.0, also known as MSVC.
Solution:
To resolve this issue, follow these steps:
-
Determine your Python version: Execute the command python --version in a terminal or command prompt to check your Python version. This will help determine the appropriate MSVC redistributable package to download.
-
Download Microsoft Visual C 14.0 Redistributable: Navigate to the Microsoft website and download the MSVC redistributable package for your version of Windows.
-
Install MSVC Redistributable: Run the installer and follow the on-screen instructions to install the MSVC redistributable package.
-
Reinstall PyAudio: After successfully installing MSVC, you can now reinstall pyaudio using the following command:
python -m pip install PyAudio
Copy after login
-
Verify Installation: Once the installation is complete, import pyaudio in your Python script to verify if it's working properly.
Alternate Method (in case pip installation fails):
-
Download the PyAudio wheel file: Visit the PyAudio website and download the appropriate wheel file for your Python version and operating system (e.g., PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl).
-
Navigate to the downloaded file: Use the cd command in a terminal or command prompt to navigate to the directory where the wheel file is downloaded.
-
Install PyAudio using pip: Execute the following command to install PyAudio using the wheel file:
pip install path_to_wheel_file
Copy after login
For example, if your wheel file is located at ~/Downloads/PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl, the command would be:
pip install ~/Downloads/PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl
Copy after login
The above is the detailed content of Why Am I Getting the 'Microsoft Visual C 14.0 is Required' Error During PyAudio Installation on Windows?. For more information, please follow other related articles on the PHP Chinese website!