# Setting up PyCharm for addon development

**URL:** <https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232>\
**Category:** Development\
**Created:** [June 16, 2020, 11:33pm UTC](https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232 "2020-06-16T23:33:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![maiap](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@maiap](https://forums.ankiweb.net/u/maiap)\
**Post date:** [June 16, 2020, 11:33pm UTC](https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232/1 "2020-06-16T23:33:29Z")

</div>

I’m having problems following this tutorial: [https://addon-docs.ankiweb.net/#/getting-started](https://addon-docs.ankiweb.net/#/getting-started)

When I try to run these commands in the Python console:

import subprocess  
subprocess.check\_call([“pip”, “install”, “mypy”, “anki”, “ankirspy”, “aqt”])

I get the following output:

Collecting mypy  
Using cached mypy-0.780-py3-none-any.whl (1.8 MB)  
Collecting anki  
Using cached anki-2.1.26-py3-none-any.whl (156 kB)  
ERROR: Could not find a version that satisfies the requirement ankirspy (from versions: none)  
ERROR: No matching distribution found for ankirspy  
Traceback (most recent call last):  
File “”, line 1, in   
File “E:\Python\lib\subprocess.py”, line 347, in check\_call  
raise CalledProcessError(retcode, cmd)  
subprocess.CalledProcessError: Command ‘[‘pip’, ‘install’, ‘mypy’, ‘anki’, ‘ankirspy’, ‘aqt’]’ returned non-zero exit status 1.

I’m new to using the Python console, but I have a basic understanding of what subprocess.check\_call does; I just can’t figure out this error. I’m running Windows 10, and I’ve tried this with both Python 3.7.6 (PIP version 19.0.3) and Python 3.6.0 .

---

<div class="post-metadata">

**Author:** ![addons\_zz](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/addons_zz/32/43_2.png) [@addons\_zz](https://forums.ankiweb.net/u/addons_zz)\
**Post date:** [June 17, 2020, 12:08am UTC](https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232/2 "2020-06-17T00:08:04Z")

</div>

> [@maiap](#):
>
> subprocess.check\_call([“pip”, “install”, “mypy”, “anki”, “ankirspy”, “aqt”])

Try running:

1. `subprocess.check_call(["python", "-m", "pip", "uninstall", "mypy", "anki", "ankirspy", "aqt"])`
2. `subprocess.check_call(["python", "-m", "pip", "install", "mypy", "anki", "ankirspy", "aqt"])`

Do you have pip installed? You can try installing it with `subprocess.check_call(["python", "-m", "ensurepip"])`

---

<div class="post-metadata">

**Author:** ![maiap](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@maiap](https://forums.ankiweb.net/u/maiap)\
**Post date:** [June 17, 2020, 12:49am UTC](https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232/3 "2020-06-17T00:49:10Z")

</div>

I have pip (20.1.1) installed, checking it in PyCharm works fine. Running those commands didn’t help any; it says mypy, anki, ankirspy, and aqt all weren’t installed, then gives me the same error.

---

<div class="post-metadata">

**Author:** ![addons\_zz](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/addons_zz/32/43_2.png) [@addons\_zz](https://forums.ankiweb.net/u/addons_zz)\
**Post date:** [June 17, 2020, 12:51am UTC](https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232/4 "2020-06-17T00:51:07Z")

</div>

Try install individually each one of the required modules:

1. subprocess.check\_call([“python”, “-m”, “pip”, “install”, “mypy”])
2. subprocess.check\_call([“python”, “-m”, “pip”, “install”, “anki”])
3. subprocess.check\_call([“python”, “-m”, “pip”, “install”, “ankirspy”])
4. subprocess.check\_call([“python”, “-m”, “pip”, “install”, “aqt”])

What is your Python version?

---

<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:** [June 17, 2020, 2:04am UTC](https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232/5 "2020-06-17T02:04:43Z")

</div>

The file on PyPI requires a 64 bit build of Python. Perhaps you are using a 32 bit Python?

---

<div class="post-metadata">

**Author:** ![maiap](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@maiap](https://forums.ankiweb.net/u/maiap)\
**Post date:** [June 17, 2020, 6:05pm UTC](https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232/6 "2020-06-17T18:05:18Z")

</div>

Getting a bit closer. I tried this with a Python 3.6.0 (64-bit) virtual environment, and mypy installs successfully, but I’m still getting the same error with anki, ankirspy, and aqt. My hunch is that there’s no release for these modules that’s compatible with Python 3.6.0 …

Can someone tell me what Python version they’re using that got it working?

---

<div class="post-metadata">

**Author:** ![addons\_zz](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/addons_zz/32/43_2.png) [@addons\_zz](https://forums.ankiweb.net/u/addons_zz)\
**Post date:** [June 17, 2020, 6:10pm UTC](https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232/7 "2020-06-17T18:10:02Z")

</div>

Anki requires at least Python 3.7 to work: [https://github.com/ankitects/anki/blob/master/README.development](https://github.com/ankitects/anki/blob/master/README.development)

---

<div class="post-metadata">

**Author:** ![maiap](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@maiap](https://forums.ankiweb.net/u/maiap)\
**Post date:** [June 17, 2020, 6:39pm UTC](https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232/8 "2020-06-17T18:39:35Z")

</div>

Great, that explains it. I tried this with Python 3.7 (32-bit), which is incompatible with PyPl, and Python 3.6 (64-bit), which is incompatible with Anki. Just got it working with Python 3.8.3 (64-bit).

Thanks for the help @dae and @addons_zz!

---

<div class="post-metadata">

**Author:** ![Asani2k](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Asani2k](https://forums.ankiweb.net/u/Asani2k)\
**Post date:** [November 27, 2020, 3:40am UTC](https://forums.ankiweb.net/t/setting-up-pycharm-for-addon-development/232/9 "2020-11-27T03:40:55Z")

</div>

used this instead and its seems to work on my machine:  
subprocess.check\_call([“python3”, “-m”, “pip”, “install”, “mypy”, “anki”, “ankirspy”, “aqt”])

---

<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/setting-up-pycharm-for-addon-development/232/10 "2023-05-01T03:20:11Z")

</div>


