Code Monkey home page Code Monkey logo

Comments (8)

dvonthenen avatar dvonthenen commented on August 15, 2024

That's actually a 100% intentional.

Please see:
#302

In case that issue isn't clear, on certain platforms, the pip install deepgram-sdk will fail if portaudio isn't installed. That would force people with a hard requirement to install portaudio just to use the SDK when they might not be interested in any of the examples that use it.

All the examples that use the Microphone have documentation in the README.md to install (like brew install portaudio or whatever it is for your platform) before running.

from deepgram-python-sdk.

Tenzer avatar Tenzer commented on August 15, 2024

This wasn't a problem in version 3.2.7 which is why I am reporting it.

The problem seems to stem from the import which is done at the class-level here:

import pyaudio # pylint: disable=import-outside-toplevel

It attempts to import pyaudio as soon as the Microphone class is parsed by Python, which is done as soon as import deepgram is done.

Since that import is only used for type checking, it can instead be put in a conditional, so this isn't a problem. I'll make a PR in a moment to demonstrate.

from deepgram-python-sdk.

dvonthenen avatar dvonthenen commented on August 15, 2024

ooooh you are reportng that it is giving you the error. now I see what you are saying. If you want to do the PR to remove the line, that would be awesome. Otherwise, I can.

from deepgram-python-sdk.

Tenzer avatar Tenzer commented on August 15, 2024

Yep, exactly. See #419.

from deepgram-python-sdk.

dvonthenen avatar dvonthenen commented on August 15, 2024

I think TYPE_CHECKING was introduced a little later in v3. I will need to see if this works for the supported versions of of the SDK.

from deepgram-python-sdk.

dvonthenen avatar dvonthenen commented on August 15, 2024

@Tenzer would you happen to know if this works for 3.10? and I have been working on a side project on getting the SDK to work on 3.9 (because some have been complaining about this) but I haven't been able to devote a ton of time to it.

from deepgram-python-sdk.

Tenzer avatar Tenzer commented on August 15, 2024

As mentioned here, typing.TYPING_CHECKING was added in Python 3.5.2 according to the documentation, so I don't see why it shouldn't work.

from deepgram-python-sdk.

dvonthenen avatar dvonthenen commented on August 15, 2024

@Tenzer thanks again for the PR. just posted a new release with this fix:
https://github.com/deepgram/deepgram-python-sdk/releases/tag/v3.3.1

from deepgram-python-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.