s0d3s / PyAudioWPatch

🐍 PyAudio | PortAudio fork with WASAPI loopback support 🔊 Record audio from speakers on Windows
Other
138 stars 8 forks source link

Could not import the PyAudio C module '_portaudiowpatch'. #6

Closed SethTurin closed 1 year ago

SethTurin commented 1 year ago

Hi

I'm running into an error and I've burned several hours on it with no progress.

I'm using windows 11 with an embeddable python installation. I get the same error with python 3.7 and python 3.11. I do not get the error with a normal python installation, which leads me to believe the issue has something to do with the embeddable installation. The error does not occur with pyaudio.

Here's the error:


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\x\AppData\Roaming\app\python\Lib\site-packages\pyaudiowpatch\__init__.py", line 132, in <module>
    import _portaudiowpatch as pa
ImportError: DLL load failed: The specified module could not be found.```

Any thoughts?
s0d3s commented 1 year ago

Hi🖐

Judging by the error, you are missing a compiled C extension of PyAudioWPatch.

These are the consequences of an incorrect installation. How did you install the library? Using pip or manually?

Try to reinstall using this command:

pip install --upgrade --force-reinstall --no-cache-dir pyaudiowpatch

If there are still problems after that:

P.S. I rechecked on python 3.7 (with a full reinstall), no problems.

SethTurin commented 1 year ago

Hey sorry for the delay in answering this. The files are all definitely there, and I know I installed it correctly because it works fine with my full installation of python. This might be a bug in the embedded python distribution, but I'm not really sure how to even address it.

GregCloudPark commented 1 year ago

Hi, how did you resolved this problem?

GregCloudPark commented 1 year ago

Solved! For some reason I was using Python3.7 for 32bit systems despite my system being 64bit '-'

SethTurin commented 1 year ago

Solved! For some reason I was using Python3.7 for 32bit systems despite my system being 64bit '-'

so you had the same issue and resolved it by using the 64 bit distribution?

GregCloudPark commented 1 year ago

yes, my system is 64bit, so i had to use the python for 64 bit systems