# Has the previewer code changed?

**URL:** <https://forums.ankiweb.net/t/has-the-previewer-code-changed/5186>\
**Category:** Development\
**Created:** [November 17, 2020, 10:07am UTC](https://forums.ankiweb.net/t/has-the-previewer-code-changed/5186 "2020-11-17T10:07:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sam](https://forums.ankiweb.net/u/sam)\
**Post date:** [November 17, 2020, 10:07am UTC](https://forums.ankiweb.net/t/has-the-previewer-code-changed/5186/1 "2020-11-17T10:07:25Z")

</div>

I have been programming an add-on on 2.1.26, recently switched to 2.1.35 and now it displays an error message:

widg.open()  
File “aqt/previewer.py”, line 61, in open  
File “aqt/previewer.py”, line 137, in render\_card  
File “aqt/previewer.py”, line 54, in card\_changed  
NotImplementedError

I can’t find any changes to the code on github, so any ideas why it’s not now working?

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [November 17, 2020, 10:15am UTC](https://forums.ankiweb.net/t/has-the-previewer-code-changed/5186/2 "2020-11-17T10:15:29Z")

</div>

The code has changed quite a bit and some classes got removed altogether.

See:  
[previewer.py#L236](https://github.com/ankitects/anki/blob/e0550b6084a953cb820b655190f295749f40c1b2/qt/aqt/previewer.py#L236)

> <https://github.com/ankitects/anki/commit/61e8611b7baa292c43693669fc79b7ae552e8585>

---

<div class="post-metadata">

**Author:** ![sam](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sam](https://forums.ankiweb.net/u/sam)\
**Post date:** [November 17, 2020, 11:40am UTC](https://forums.ankiweb.net/t/has-the-previewer-code-changed/5186/3 "2020-11-17T11:40:57Z")

</div>

That’s weird, I’m not using any of that code so that commit shouldn’t affect me.

I’m using the Previewer class which is in the latest version (or at least seems to be), but when i call open() it is coming up with the not implemented error. Why is this happening?

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [November 17, 2020, 1:35pm UTC](https://forums.ankiweb.net/t/has-the-previewer-code-changed/5186/4 "2020-11-17T13:35:34Z")

</div>

The Previewer class has no implementations for the `card` and `card_changed` methods (they both throw `NotImplementedError`). And they are both called indirectly by `open`.

You have to either write your own class that derives from Previewer and provides implementations for the missing methods, or simply use the `BrowserPreviewer` class (which is what Anki actually uses in the browser).

---

<div class="post-metadata">

**Author:** ![sam](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sam](https://forums.ankiweb.net/u/sam)\
**Post date:** [November 17, 2020, 3:31pm UTC](https://forums.ankiweb.net/t/has-the-previewer-code-changed/5186/5 "2020-11-17T15:31:33Z")

</div>

That was it, thank you.

I was thrown off thinking it was the open not implemented.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 3:20am UTC](https://forums.ankiweb.net/t/has-the-previewer-code-changed/5186/6 "2023-05-01T03:20:16Z")

</div>


