# DLL error when importing modules in Python

**URL:** <https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322>\
**Category:** Development\
**Created:** [September 15, 2023, 2:03am UTC](https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322 "2023-09-15T02:03:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![momoic](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@momoic](https://forums.ankiweb.net/u/momoic)\
**Post date:** [September 15, 2023, 2:03am UTC](https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322/1 "2023-09-15T02:03:50Z")

</div>

I am trying to create and edit collections in Python. However, when I try to import \_rsbridge in Python, either through `from anki.collection import Collection` or directly, I get the following error:

“ImportError: DLL load failed while importing \_rsbridge: The specified procedure could not be found.”

Am I doing something wrong with the importing or is there another issue?

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 15, 2023, 3:17am UTC](https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322/2 "2023-09-15T03:17:58Z")

</div>

How did you install Anki, and are you using Python 3.9+?

---

<div class="post-metadata">

**Author:** ![momoic](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@momoic](https://forums.ankiweb.net/u/momoic)\
**Post date:** [September 15, 2023, 3:30am UTC](https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322/3 "2023-09-15T03:30:34Z")

</div>

I installed Anki off of Ankiweb (version 2.1.66 Qt6), downloaded the anki library with pip, and I’m running Python 3.9.1

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 15, 2023, 3:39am UTC](https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322/4 "2023-09-15T03:39:13Z")

</div>

Was Python downloaded from [python.org](http://python.org)? Maybe a newer 3.9.x version may fare better?

---

<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:** [September 15, 2023, 3:49am UTC](https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322/5 "2023-09-15T03:49:41Z")

</div>

> [@momoic](#):
>
> “ImportError: DLL load failed while importing \_rsbridge: The specified procedure could not be found.”

This might be related: [Problem with Qt6 but not with Qt5 · Issue #2459 · ankitects/anki · GitHub](https://github.com/ankitects/anki/issues/2459)

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [September 15, 2023, 4:02am UTC](https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322/6 "2023-09-15T04:02:32Z")

</div>

Good catch, that’s possible. While Qt is not involved here, I think we depend on some TTS functionality that was not in the original Windows 10 release.

---

<div class="post-metadata">

**Author:** ![momoic](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@momoic](https://forums.ankiweb.net/u/momoic)\
**Post date:** [September 15, 2023, 4:14am UTC](https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322/7 "2023-09-15T04:14:45Z")

</div>

Updating to Python version 3.11.5 fixed the problem. Thank you!

---

<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:** [October 15, 2023, 4:14am UTC](https://forums.ankiweb.net/t/dll-error-when-importing-modules-in-python/34322/8 "2023-10-15T04:14:51Z")

</div>

Closed on October 15, 2023, 4:14am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
