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

ImportError: cannot import name 'OpusEncoder' from 'pyogg' #56

Open
tobischw opened this issue Oct 27, 2020 · 8 comments
Open

ImportError: cannot import name 'OpusEncoder' from 'pyogg' #56

tobischw opened this issue Oct 27, 2020 · 8 comments
Milestone

Comments

@tobischw
Copy link

Hi,

I am on Windows 10 and followed the instructions for installing PyOgg.
However, everytime I attempt to use it, I am greeted with this error:

ImportError: cannot import name 'OpusEncoder' from 'pyogg'

I installed it the normal way using pip install in an Anaconda environment.
Any help would be appreciated.

@mattgwwalker
Copy link
Collaborator

That sounds very frustrating. I too would have just expected it to work out-of-the-box.

I wasn't aware that'd we'd released any versions with OpusEncoder included.

The version that I see that is available on PyPI is PyOgg 0.6.14a1 (https://pypi.org/project/PyOgg/)

And when I look up that version on GitHub I don't see any references to OpusEncoder. (https://github.com/TeamPyOgg/PyOgg/tree/c53233cdbbb485ca365337d9621fe33a0e39152a/pyogg)

So I'm at a bit of a loss. @Zuzu-Typ do you know how Tobi might have a version that includes OpusEncoder?

@tobischw, is it possible that you specified the in-development version from the GitHub repository when you issued the pip install command? Could you please share with us the full command that you used?

What version does pip list report for pyogg?

Cheers,

Matthew

@mattgwwalker
Copy link
Collaborator

It's worth notating however that I haven't tried using PyOgg with Anaconda.

@Zuzu-Typ
Copy link
Collaborator

Hi there you two,

@mattgwwalker I think you misinterpreted the issue. The problem is not that OpusEncoder exists, but rather that it does not, even though it's used in the examples on GitHub. It's most likely imported like this from pyogg import OpusEncoder and that doesn't work with the old versions of course.

@tobischw As of now, we haven't yet published the many changes that matthew has made to the PyPI yet, probably because we don't feel like it's completed yet. For the time being, try to refer to the documentation on here.
Alternatively, you can also clone (i.e. download) the project from here, which should work the intended way
(e.g. by using pip install git+https://github.com/TeamPyOgg/PyOgg).

Maybe we should push an updated version some time in the not too far future.

Cheers,
--Zuzu_Typ--

@mattgwwalker
Copy link
Collaborator

mattgwwalker commented Oct 27, 2020 via email

@tobischw
Copy link
Author

tobischw commented Nov 2, 2020

Hi,

from reading your comments, I am assuming that OpusEncoder was simply not published yet, hence why it cannot be imported. I actively was looking for a library that makes Opus encoding a bit easier, so I assumed that this was part of it. That's most likely my fault for assuming that it has been released - not quite sure how I landed on the documentation then. No worries, I appreciate your work and your help.

Thanks,
Tobi

@ctron
Copy link

ctron commented Dec 16, 2020

I just ran into the same issue, just with the OpusBufferedEncoder.

Installed with:

pip3 install pyogg

And then the examples don't work, as the file containing OpusBufferedEncoder seems to be missing.

@mattgwwalker
Copy link
Collaborator

Sorry that you had the same issue. It will be resolved when we release the next version of PyOgg, which should happen soon.

If you would like to use the as-yet-unreleased code (which includes OpusBufferedEncoder), please clone the master branch of the repository and install that:

git clone https://github.com/TeamPyOgg/PyOgg.git
pip install -e .

Cheers,

Matthew

@ctron
Copy link

ctron commented Dec 16, 2020

Thanks for the response. I completely understand. It was just confusing for me, as the README file points to the docs, and the docs already contain the information. Maybe have two docs: "latest released" and "latest"

I went with the solution mentioned above:

pip3 install git+https://github.com/TeamPyOgg/PyOgg@c78487ef52960d98ab3af5b66a744af8a5efe686

Which gives me some "stable" (in the form of a git commit hash) version, and still provides the unreleased functionality. Looked good so far. Thanks!

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

4 participants