Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.7 and installed 3.6 to use pocketsphinx, and now I want to upgrade PyAudio of my 3.6. doing pip install --upgrade pyaudio is upgrading the pyaudio of 3.7. So, how do i upgrade(or even install) packages of specific python versions on a windows machine?

Here's also what I've tried:
python-3.6.6 pip install --upgrade pyaudio,
python3.6.6 pip install --upgrade pyaudio,
python3.6 pip install --upgrade pyaudio and
pip3.6.6 install --upgrade pyaudio.
Yes, these may be stupid, but I was helpless.

EDIT 1:
I also run pip install --upgrade pyaudio in power shell by opening it in the directory where my python 3.6 is installed, which is(default installation directory for windows): C:\Users\--user-name--\AppData\Local\Programs\Python\Python36 like: this is what's happening and it's not working as you can see from the version, pip install would still install new packages for python 3.7

like image 671
Naveen Reddy Marthala Avatar asked Aug 30 '26 20:08

Naveen Reddy Marthala


1 Answers

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 👍😊

like image 94
Aditya Singh Avatar answered Sep 01 '26 10:09

Aditya Singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!