# ImportError: No module named json\_tricks

**URL:** <https://discourse.psychopy.org/t/importerror-no-module-named-json-tricks/3392>\
**Category:** Coding\
**Created:** [November 6, 2017, 3:33pm UTC](https://discourse.psychopy.org/t/importerror-no-module-named-json-tricks/3392 "2017-11-06T15:33:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mira](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@mira](https://discourse.psychopy.org/u/mira)\
**Post date:** [November 6, 2017, 3:33pm UTC](https://discourse.psychopy.org/t/importerror-no-module-named-json-tricks/3392/1 "2017-11-06T15:33:49Z")

</div>

Hi everyone,

I’m new to psychopy and installed standalone psychopy on  
ubuntu using

sudo apt-get install psychopy.

When I try to open the Monitor Center in the psychopy coder GUI I get

ImportError: No module named json\_tricks

even though json\_tricks is installed and it is possible to open the Monitor Center in the builder GUI without getting this error. Furthermore the same error occurs every time I try to run any script in psychopy builder or coder (including the demo scripts).

Has anyone any suggestions what could have gone wrong during installation or why psychopy is not able to import json\_tricks?

Thank you for any help or idea!

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [November 8, 2017, 12:09pm UTC](https://discourse.psychopy.org/t/importerror-no-module-named-json-tricks/3392/2 "2017-11-08T12:09:29Z")

</div>

Most likely you’ve ended up with multiple python installations and json\_tricks is installed in one but not the other. You can find out which python is being used as below, so you could test that from within Coder and from your terminal, to see if they differ:

```auto
import sys
print(sys.executable)

```

---

<div class="post-metadata">

**Author:** ![mira](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@mira](https://discourse.psychopy.org/u/mira)\
**Post date:** [November 9, 2017, 10:38am UTC](https://discourse.psychopy.org/t/importerror-no-module-named-json-tricks/3392/3 "2017-11-09T10:38:44Z")

</div>

Thank you for your response! You pointed me to the right direction. I had two different python versions installed and json\_tricks was installed only in one of them and not in the one psychopy used. So I installed it in the other version too and now everything works perfectly.

---

<div class="post-metadata">

**Author:** ![Elle](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@Elle](https://discourse.psychopy.org/u/Elle)\
**Post date:** [May 21, 2018, 1:49pm UTC](https://discourse.psychopy.org/t/importerror-no-module-named-json-tricks/3392/4 "2018-05-21T13:49:40Z")

</div>

Hi,

I’m getting same error:

brain@neurodebian:/usr/lib/python2.7$ python …/…/…/home/brain/Desktop/exp.py  
Traceback (most recent call last):  
File “…/…/…/home/brain/Desktop/exp.py”, line 8, in   
from psychopy import visual, event, core, data  
File “/usr/lib/python2.7/dist-packages/psychopy/visual/ **init**.py”, line 17, in   
from .window import Window, getMsPerFrame, openWindows  
File “/usr/lib/python2.7/dist-packages/psychopy/visual/window.py”, line 57, in   
from psychopy import core, platform\_specific, logging, prefs, monitors, event  
File “/usr/lib/python2.7/dist-packages/psychopy/monitors/ **init**.py”, line 5, in   
from .calibTools import \*  
File “/usr/lib/python2.7/dist-packages/psychopy/monitors/calibTools.py”, line 34, in   
import json\_tricks # allows json to dump/load np.arrays and dates  
**ImportError: No module named json\_tricks**  
brain@neurodebian:/usr/lib/python2.7$

When running suggested command I get like this:  
**\>\>\> import sys**  
**\>\>\> print(sys.executable)**  
**/usr/bin/python**  
**\>\>\>**

It seems that multiple pythons are installed on my machine also.

I’m not sure how to continue as jon described! May you tell me what to exactly do? How to bypass this?

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [May 21, 2018, 6:29pm UTC](https://discourse.psychopy.org/t/importerror-no-module-named-json-tricks/3392/5 "2018-05-21T18:29:41Z")

</div>

I think you can execute pip as a module using the -m flag in Python and that means you can specify directly _which_ pip is used (whereas calling `pip install xxxx` will just use the first instance of `pip` found on the system path). So try doing this to install json\_tricks into the python that you are actually using

```auto
python -m pip install json_tricks

```

or even

```auto
/usr/bin/python -m pip install json_tricks

```

---

<div class="post-metadata">

**Author:** ![simon.dp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/simon.dp/32/6313_2.png) [@simon.dp](https://discourse.psychopy.org/u/simon.dp)\
**Post date:** [May 30, 2018, 9:42am UTC](https://discourse.psychopy.org/t/importerror-no-module-named-json-tricks/3392/6 "2018-05-30T09:42:08Z")

</div>

I get the same error as the 2 other posters. It seems that my pip leads to my conda installation by default.

Running (inside the coder)

> import sys  
> print(sys.executable)

returns

> /usr/bin/python

but when I try

> /usr/bin/python -m pip install json\_tricks

it returns

> /usr/bin/python: No module named pip

Is there a way for me to address this? Tried to reinstall psychopy to no avail.
