LoginSignup
1
0

More than 3 years have passed since last update.

PyaudioをWindowsのPython仮想環境にインストールする

Last updated at Posted at 2021-03-21

Windows10で仮想環境にPyaudioをインストールする際に少し手間取ったので、成功した方法をメモ

環境

Windows10 Home
pip 21.0.1

手順

①適当な.pyを作り以下のコードをコピペして実行

  • pipのバージョンによって、1行目が異なるので注意
  • pip get_supportedなどで検索
from pip._internal.utils.compatibility_tags import get_supported
print(get_supported())
  • リストに表示されるcp〇〇が後で必要になるため覚えておく

    • 画像ではcp32 ~ cp38

      pip_cap.PNG

②このサイト (https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio) から、先ほどのcpの値と自分のPCのビット数に応じたものをダウンロード

  • 今回は、PyAudio‑0.2.11‑cp38‑cp38‑win_amd64.whlをダウンロード

③仮想環境をアクティブにするため、コマンドプロンプトを開いて以下のコマンドを打つ

  • pathは仮想環境のパスを入力
path\venv\Script\activate

例:C:\Users\****\PycharmProjects\〇〇\venv\Scripts\activate

④先ほどダウンロードした.whlファイルをpipを用いてインストールするため、引き続きコマンドプロンプトで以下のコマンドを打つ

pip install path\Pyaudio-0.2.11-cp-38-cp38-win_amd64.whl

例:pip install C:\Users\****\Downloads\Pyaudio-0.2.11-cp-38-cp38-win_amd64.whl
  • 以下のような出力が出れば成功
Processing path\pyaudio-0.2.11-cp38-cp38-win_amd64.whl
Installing collected packages: PyAudio
Successfully installed PyAudio-0.2.11

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0