# Unit error when sending experiment to Pavlovia

**URL:** <https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045>\
**Category:** Builder\
**Tags:** pavlovia\
**Created:** [March 15, 2019, 4:23am UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045 "2019-03-15T04:23:06Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurafdeza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/laurafdeza/32/4165_2.png) [@laurafdeza](https://discourse.psychopy.org/u/laurafdeza)\
**Post date:** [March 15, 2019, 4:23am UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/1 "2019-03-15T04:23:06Z")

</div>

**OS** (e.g. Win10): MacOS Mojave 10.14.3  
**PsychoPy version** (e.g. 1.84.x): 3.0.2  
**Standard Standalone? (y/n)** If not then what?: Yes  
**What are you trying to achieve?:**

I am trying to administer an experiment online so users without PsychoPy can also complete the experiment.

**What specifically went wrong when you tried that?:**

The first screen to enter the participant’s name works fine, but then the following error message pops up:

 ![43%20AM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/8/f/8fced51d0093dcf84e4b72afd5a2aa805d83c704.png)

**What did you try to make it work?:**

I tried changing the units under preferences, settings, my text stimuli and a combination of the three. I tried with the different alternatives offered as well (pix, norm, deg…)

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [March 15, 2019, 8:36am UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/2 "2019-03-15T08:36:21Z")

</div>

Hi @laurafdeza, this was fixed in [3.0.4](https://github.com/psychopy/psychopy/releases/tag/3.0.4). We fixed this by changing the screen units in experiment settings to default to ‘height’ units.

---

<div class="post-metadata">

**Author:** ![laurafdeza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/laurafdeza/32/4165_2.png) [@laurafdeza](https://discourse.psychopy.org/u/laurafdeza)\
**Post date:** [March 19, 2019, 1:07am UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/3 "2019-03-19T01:07:47Z")

</div>

Thank you @dvbridges, but it still doesn’t work. I’m also having other problems, like when I tried to add a text stimuli, this happens

 ![30%20PM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/2/a/2a2c9d9fa4f427b40b0d79f82ec65936a8158806.png)

and no stimuli is added. I tried the v3.0.6 too and it threw the same error. I uninstalled PsychoPy and reinstalled it and restarted the laptop and nothing worked.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [March 19, 2019, 8:41am UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/4 "2019-03-19T08:41:29Z")

</div>

Ok, I have not been able to recreate the error. Would you mind sharing your experiment with me so I can take a look? Just a minimal example that shows the error will be fine.

---

<div class="post-metadata">

**Author:** ![laurafdeza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/laurafdeza/32/4165_2.png) [@laurafdeza](https://discourse.psychopy.org/u/laurafdeza)\
**Post date:** [March 19, 2019, 2:31pm UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/5 "2019-03-19T14:31:41Z")

</div>

Of course, @dvbridges. Here is the link to the GitHub repo with the experiment

> **[laurafdeza/PsychoPy\_collocations](https://github.com/laurafdeza/PsychoPy_collocations)**
>
> Contribute to laurafdeza/PsychoPy\_collocations development by creating an account on GitHub.

The idea behind this short task is that participants will hear figurative expressions in Spanish and they will have to choose with a mouse-click the equivalent expression in English from the list available for them on the screen. In total it is 8 expressions in Spanish, but the possible answers in English are 12, so the solution is not as straightforward.

I think the problem might be in my laptop, rather than the software, or some issue in the more basic code, as it will literally not let me do anything in PsychoPy. It does not matter what icon is clicked, nothing happens, regardless of whether it is the experiment already build or starting a new one from scratch. I’m going to try installing v3.0.4.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [March 20, 2019, 11:22am UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/6 "2019-03-20T11:22:46Z")

</div>

Thanks @laurafdeza, really useful to send me a link to your repo :). In short, your problems stem from the mixed screen units you are using. I advise setting all units to height, or pixels (which you currently use), and making sure you size your components accordingly.

### Running experiment locally in Builder

Running locally I cannot see text on screen because your text size is `.1`, (the default size when using Height or Norm screen units) and your text components are set to use `pix`. As this is smaller than a pixel, text will not be drawn and will not appear on screen. [See docs](https://www.psychopy.org/general/units.html).

### Running experiment online

As above, components set to pix should either be given sizes in pixels e.g., anything \> 1, or sized according to height or norm units ([see docs](https://www.psychopy.org/general/units.html)). If you attempt to draw something with a size smaller than 1 pixel, you will get an error, something like:

```javascript
IndexSizeError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source width is 0.

```

### Setting your components to update correctly

Many of your component parameters are set to update on every repeat, but you are not actually passing a variable to them, so they do not need updating, they can stay constant ([see docs](https://www.psychopy.org/builder/components.html#how-often-to-evaluate-the-variable-code)). So, only update those params that contain a variable i.e., column from your conditions file.

---

<div class="post-metadata">

**Author:** ![laurafdeza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/laurafdeza/32/4165_2.png) [@laurafdeza](https://discourse.psychopy.org/u/laurafdeza)\
**Post date:** [March 20, 2019, 4:30pm UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/7 "2019-03-20T16:30:11Z")

</div>

Thank you very much @dvbridges! It all makes sense.  
However, right now I am not able to get there. The software is still not letting me add or modify input, regardless of what version is being used or whether the software as being uninstalled and reinstalled. I recorded a video to show you what I mean. It is in the GitHub repo under the title “PsychoPy\_issue.”

> **[laurafdeza/PsychoPy\_collocations](https://github.com/laurafdeza/PsychoPy_collocations)**
>
> Contribute to laurafdeza/PsychoPy\_collocations development by creating an account on GitHub.

I’m so sorry for all the inconveniences.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [March 20, 2019, 5:00pm UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/8 "2019-03-20T17:00:46Z")

</div>

> [@laurafdeza](#):
>
> MacOS Mojave 10.14.3

Ah I see, thanks for the video that was very helpful. It is possible it is related to [this post about missing fonts after Mojave 10.14 update](https://discussions.apple.com/thread/8570701).

@jon, have you come across this wx issue with invalid fonts on MacOS Mojave 10.14.3? (The error message is in one of the previous post - the error outputs every time a component is clicked and fails to add a component to the routine).

---

<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:** [March 21, 2019, 2:34pm UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/9 "2019-03-21T14:34:02Z")

</div>

Hmm, yes, David’s link looks like a candidate for the issue. When you open Font Book on the offending Mac do your fonts show up?

I’m running on Mojave 10.14.2 myself and not experiencing any issues, so I don’t think this is a general thing. That said I’ll try updating a machine to 10.14.3 and see if that breaks anything

---

<div class="post-metadata">

**Author:** ![laurafdeza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/laurafdeza/32/4165_2.png) [@laurafdeza](https://discourse.psychopy.org/u/laurafdeza)\
**Post date:** [March 21, 2019, 8:48pm UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/10 "2019-03-21T20:48:23Z")

</div>

Hello @jon. Yes, the fonts do show up.

---

<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:** [March 22, 2019, 9:59am UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/11 "2019-03-22T09:59:15Z")

</div>

I’ve now upgraded to 10.14.3 and still no problems at my end.

I wonder if there’s a problem with the specific font that we’re trying to use for the coder. Are you able to get to the application preferences within PsychoPy without a crash? My preferences have Monaco as my code font. What is yours?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/8/3/834f57fc9af0521c129ad6f08d7347c0d75bb8e6.jpeg)

---

<div class="post-metadata">

**Author:** ![laurafdeza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/laurafdeza/32/4165_2.png) [@laurafdeza](https://discourse.psychopy.org/u/laurafdeza)\
**Post date:** [March 22, 2019, 4:03pm UTC](https://discourse.psychopy.org/t/unit-error-when-sending-experiment-to-pavlovia/7045/12 "2019-03-22T16:03:28Z")

</div>

It was Arial. Changing it to Monaco did not help. However, playing around with the preferences, I clicked on “Reset preferences” under “App,” restarted PsychoPy and now it seems to be working. Thank you both for your help!
