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

Cannot import "EncodingQuality" from "depthai_sdk" #478

Closed
kimjsik08 opened this issue May 15, 2023 · 5 comments · May be fixed by #480
Closed

Cannot import "EncodingQuality" from "depthai_sdk" #478

kimjsik08 opened this issue May 15, 2023 · 5 comments · May be fixed by #480

Comments

@kimjsik08
Copy link

kimjsik08 commented May 15, 2023

I am having this error:

Traceback (most recent call last):
  File "C:\Users\kimjs\PycharmProjects\OakD\depthai-experiments\gen2-record-replay\record.py", line 12, in <module>
    from depthai_sdk import Record, EncodingQuality
ImportError: cannot import name 'EncodingQuality' from 'depthai_sdk' (C:\Users\kimjs\PycharmProjects\OakD\venv\Lib\site-packages\depthai_sdk\__init__.py)

I tried to manually go through sdk files and find "EncodingQuality" function, but I could not. Am I missing something here?

Maybe it has to do something with the fact that I had a problem installing something from requirements.txt file?

Building wheels for collected packages: depthai
  Building wheel for depthai (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for depthai (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [72 lines of output]

Maybe this error is not an issue because I already had depthai 2.21 installed...

@Erol444
Copy link
Member

Erol444 commented May 15, 2023

Hi @kimjsik08 , do you have depthai-sdk version 1.2.3 installed, as per requirements.txt?

@kimjsik08
Copy link
Author

Hello, I applied your fix and now I am getting a new type of error!

  File "C:\Users\kimjs\PycharmProjects\OakD\depthai-experiments\gen2-record-replay\record.py", line 17, in <module>
    _quality_choices = tuple(str(q).split('.')[1] for q in EncodingQuality)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kimjs\PycharmProjects\OakD\depthai-experiments\gen2-record-replay\record.py", line 17, in <genexpr>
    _quality_choices = tuple(str(q).split('.')[1] for q in EncodingQuality)
                             ~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

@Erol444 Erol444 linked a pull request May 20, 2023 that will close this issue
@Erol444
Copy link
Member

Erol444 commented May 20, 2023

Hi @kimjsik08 , Could you please try #480 ?

@whyhowie
Copy link

I think you could change that line 17 into:
_quality_choices = tuple([q.name for q in EncodingQuality])
Should fix the problem.

@kimjsik08
Copy link
Author

_quality_choices = tuple([q.name for q in EncodingQuality])

This fixed the problem. Thanks, I appreciate it!

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

Successfully merging a pull request may close this issue.

3 participants