deepgram / deepgram-python-sdk

Official Python SDK for Deepgram's automated speech recognition APIs.
https://developers.deepgram.com
MIT License
223 stars 58 forks source link

Error when importing deepgram (unhashable type: 'list') #17

Closed netervati closed 1 year ago

netervati commented 2 years ago

Current behavior

I'm trying to test the deepgram-sdk. However, I keep on encountering this issue:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\mycomputer\.virtualenvs\Python_Stuff-EaH8Zb-h\lib\site-packages\deepgram\__init__.py", line 2, in <module>
    from ._types import Options
  File "C:\Users\mycomputer\.virtualenvs\Python_Stuff-EaH8Zb-h\lib\site-packages\deepgram\_types.py", line 172, in <module>
    EventHandler = Union[Callable[[Any], None], Callable[[Any], Awaitable[None]]]
  File "c:\users\mycomputer\appdata\local\programs\python\python39\lib\typing.py", line 243, in inner
    return func(*args, **kwds)
  File "c:\users\mycomputer\appdata\local\programs\python\python39\lib\typing.py", line 316, in __getitem__
    return self._getitem(self, parameters)
  File "c:\users\mycomputer\appdata\local\programs\python\python39\lib\typing.py", line 421, in Union
    parameters = _remove_dups_flatten(parameters)
  File "c:\users\mycomputer\appdata\local\programs\python\python39\lib\typing.py", line 215, in _remove_dups_flatten
    all_params = set(params)
TypeError: unhashable type: 'list'

Steps to reproduce

My environment

geekchick commented 2 years ago

Hi @netervati, sorry to hear you're having some issues with the import. Are you still experiencing this error? I haven't used pipenv yet with Deepgram, only virtualenv with pip. I'm using a Mac but can try and replicate your error in my Windows Azure machine.

Also, which version of Deepgram are you running?

netervati commented 2 years ago

@geekchick The version that I'm using is deepgram-sdk-0.2.5. Also, I tried installing and testing Deepgram outside of pipenv and I'm still getting the same error. For now, I'm using the cURL version.

franz-xaver-hallhuber commented 2 years ago

I am also having this issue. Does deepgram need a specific OS or Python version?

geekchick commented 2 years ago

Hi @franz-xaver-hallhuber, sorry to hear you're having trouble. Which version of Python are you using?

sankalpbhatia20 commented 2 years ago

I am also experiencing the same error. I tried using both Python2 and Python3 to install it. Although deepgram-sdk is showing up on my list of libraries installed but I am not able to import it.

(I am using deepgram-sdk 0.3.0)

geekchick commented 2 years ago

Hi @sankalpbhatia20 can you tell me the exact version of Python 3 you're using? Deepgram works with Python 3.7 and up.

geekchick commented 1 year ago

This issue was fixed in a previous version of Deepgram. To install the latest version of Deepgram do pip install deepgram-sdk . I'm closing this ticket for now. Please reach out if you have any additional questions. Thank you!