Skip to content Skip to sidebar Skip to footer

How To Install A Package For A Specific Python Version On Windows 10?

I currently have Python 3.7.4(64 bit) and Python 3.6.6(64 bit) on a Windows 10 64 bit laptop with both versions in my system environment variables(path). I previously only had 3.

Solution 1:

In CMD or powershell ,

for installing in Python 3.7:-

>py -3.7 -m pip install --upgrade pyaudio

for installing in Python 3.6:-

>py -3.6 -m pip install --upgrade pyaudio

Hope it helps 👍😊

Solution 2:

Please use the -m flag, when binding to the specific python,

$ py3.6 -m pip install --upgrade pyaudio

From the docs and is the recommended way to install modules,

The Python installers for Windows include pip. You should be able to access pip using:

py -m pip --version pip 9.0.1 from c:\python36\lib\site-packages (Python 3.6.1)

You can make sure that pip is up-to-date by running:

py -m pip install --upgrade pip

But i recommend you use some virtualenv for this.

Solution 3:

The golden rule when one wants to access one of the multiple software versions (doesn't only apply to Python) installed on a machine: use absolute paths.

There are multiple ways of pip installing (especially when involving VEnvs):

  1. Running pip directly
  2. Running python -m pip
  3. Running other convenience wrappers (e.g.py (py -3.6): [Python.Docs]: Using Python on Windows - From the command-line)

, but the form that I prefer (as it will always work), is the 2 one:

${PATH_TO_YOUR_PYTHON_3_6} -m pip install --upgrade pyaudio

where ${PATH_TO_YOUR_PYTHON_3_6} is just a placeholder for the actual Python 3.6 executable path (e.g. "%ProgramFiles%\Python 3.6\python.exe"). Check [Python.Docs]: Using Python on Windows - Installing Without UI for more details regarding install paths.

Post a Comment for "How To Install A Package For A Specific Python Version On Windows 10?"