Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'pyaudioop' #206

Open
Deveshb15 opened this issue Dec 2, 2024 · 4 comments
Open

ModuleNotFoundError: No module named 'pyaudioop' #206

Deveshb15 opened this issue Dec 2, 2024 · 4 comments

Comments

@Deveshb15
Copy link

I am on python version 3.13.0 and when I try to run below code

from podcastfy.client import generate_podcast

generate_podcast("https://www.youtube.com/watch?v=dQw4w9WgXcQ")

I get the below error

(venv) devesh@Deveshs-Laptop podcai % python3 app.py    
Traceback (most recent call last):
  File "/Users/devesh/Desktop/devesh/podcai/path/to/venv/lib/python3.13/site-packages/pydub/utils.py", line 14, in <module>
    import audioop
ModuleNotFoundError: No module named 'audioop'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/devesh/Desktop/devesh/podcai/app.py", line 1, in <module>
    from podcastfy.client import generate_podcast
  File "/Users/devesh/Desktop/devesh/podcai/path/to/venv/lib/python3.13/site-packages/podcastfy/client.py", line 15, in <module>
    from podcastfy.text_to_speech import TextToSpeech
  File "/Users/devesh/Desktop/devesh/podcai/path/to/venv/lib/python3.13/site-packages/podcastfy/text_to_speech.py", line 14, in <module>
    from pydub import AudioSegment
  File "/Users/devesh/Desktop/devesh/podcai/path/to/venv/lib/python3.13/site-packages/pydub/__init__.py", line 1, in <module>
    from .audio_segment import AudioSegment
  File "/Users/devesh/Desktop/devesh/podcai/path/to/venv/lib/python3.13/site-packages/pydub/audio_segment.py", line 11, in <module>
    from .utils import mediainfo_json, fsdecode
  File "/Users/devesh/Desktop/devesh/podcai/path/to/venv/lib/python3.13/site-packages/pydub/utils.py", line 16, in <module>
    import pyaudioop as audioop
ModuleNotFoundError: No module named 'pyaudioop'
(venv) devesh@Deveshs-Laptop podcai % python3 --version
Python 3.13.0

I've tried google colab as well still the same issue, anyone else facing this?

@souzatharsis
Copy link
Owner

souzatharsis commented Dec 2, 2024 via email

@Deveshb15
Copy link
Author

yes

(venv) devesh@Deveshs-Laptop podcai % pip install pydub
Requirement already satisfied: pydub in ./path/to/venv/lib/python3.13/site-packages (0.25.1)

[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: pip install --upgrade pip

@Deveshb15
Copy link
Author

so I downgraded to python 3.11 and this issue doesn't show up, but there's another issue I installed ffmpeg still

(venv) devesh@Deveshs-Laptop podcai % python3.11 app.py        
/opt/homebrew/lib/python3.11/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
  warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
Generating podcast...
2024-12-03 01:29:49,153 - podcastfy.client - INFO - Processing 43 links
Failed to extract content from h: HTTPSConnectionPool(host='h', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x10f783890>: Failed to resolve 'h' ([Errno 8] nodename nor servname provided, or not known)"))
Error extracting content from h: Failed to extract content from h: HTTPSConnectionPool(host='h', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x10f783890>: Failed to resolve 'h' ([Errno 8] nodename nor servname provided, or not known)"))
2024-12-03 01:29:49,252 - podcastfy.client - ERROR - An error occurred in the process_content function: Failed to extract content from h: HTTPSConnectionPool(host='h', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x10f783890>: Failed to resolve 'h' ([Errno 8] nodename nor servname provided, or not known)"))
2024-12-03 01:29:49,252 - podcastfy.client - ERROR - An error occurred: Failed to extract content from h: HTTPSConnectionPool(host='h', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x10f783890>: Failed to resolve 'h' ([Errno 8] nodename nor servname provided, or not known)"))
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connection.py", line 199, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.10/Frameworks/Python.framework/Versions/3.11/lib/python3.11/socket.py", line 974, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py", line 490, in _make_request
    raise new_e
  File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py", line 466, in _make_request
    self._validate_conn(conn)
  File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
    conn.connect()
  File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connection.py", line 693, in connect
    self.sock = sock = self._new_conn()
                       ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connection.py", line 206, in _new_conn
    raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x10f783890>: Failed to resolve 'h' ([Errno 8] nodename nor servname provided, or not known)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='h', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x10f783890>: Failed to resolve 'h' ([Errno 8] nodename nor servname provided, or not known)"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/podcastfy/content_parser/website_extractor.py", line 50, in extract_content
    response = requests.get(normalized_url, headers=headers, timeout=self.timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='h', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x10f783890>: Failed to resolve 'h' ([Errno 8] nodename nor servname provided, or not known)"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/devesh/Desktop/devesh/podcai/app.py", line 3, in <module>
    generate_podcast("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
  File "/opt/homebrew/lib/python3.11/site-packages/podcastfy/client.py", line 372, in generate_podcast
    return process_content(
           ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/podcastfy/client.py", line 95, in process_content
    contents = [content_extractor.extract_content(link) for link in urls]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/podcastfy/client.py", line 95, in <listcomp>
    contents = [content_extractor.extract_content(link) for link in urls]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/podcastfy/content_parser/content_extractor.py", line 71, in extract_content
    return self.website_extractor.extract_content(source)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/podcastfy/content_parser/website_extractor.py", line 66, in extract_content
    raise Exception(f"Failed to extract content from {url}: {str(e)}")
Exception: Failed to extract content from h: HTTPSConnectionPool(host='h', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x10f783890>: Failed to resolve 'h' ([Errno 8] nodename nor servname provided, or not known)"))
(venv) devesh@Deveshs-Laptop podcai % pip3.11 install ffmpeg
Requirement already satisfied: ffmpeg in /opt/homebrew/lib/python3.11/site-packages (1.4)

[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: python3.11 -m pip install --upgrade pip
(venv) devesh@Deveshs-Laptop podcai % 

@souzatharsis
Copy link
Owner

souzatharsis commented Dec 2, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants