# Problem with java in pavlovia:

**URL:** <https://discourse.psychopy.org/t/problem-with-java-in-pavlovia/28070>\
**Category:** Online experiments\
**Created:** [March 18, 2022, 8:39am UTC](https://discourse.psychopy.org/t/problem-with-java-in-pavlovia/28070 "2022-03-18T08:39:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marayuso](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@marayuso](https://discourse.psychopy.org/u/marayuso)\
**Post date:** [March 18, 2022, 8:39am UTC](https://discourse.psychopy.org/t/problem-with-java-in-pavlovia/28070/1 "2022-03-18T08:39:16Z")

</div>

URL of experiment:  
[https://run.pavlovia.org/marayuso/calib\_tiempos](https://run.pavlovia.org/marayuso/calib_tiempos)  
Description of the problem:  
This experiment works in psychopy but it doesn’t work in pavlovia.  
When I try to run it, there ir the message ‘initialising the experiment’ and when I press f12 there’s an error:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/7/f7c770d1d06a737a09253765f616f279377b6b06.png)

The code where the error is located is here:

![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/b/7b1e5ba35d01e82c4db4a4e36e5e49ed2cd87407.png)

Could someone help me?

Best regards.

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [March 18, 2022, 9:06am UTC](https://discourse.psychopy.org/t/problem-with-java-in-pavlovia/28070/2 "2022-03-18T09:06:18Z")

</div>

Are your testing a JS version of pandas?

The syntax for import in JS doesn’t have brackets, hence the unexpected token error.

> **[PsychoPy Python to Javascript crib sheet 2021](https://docs.google.com/document/d/183xmwDgSbnJZHMGf3yWpieV9Bx8y7fOCm3QKkMOOXFQ/edit?usp=sharing)**
>
> PsychoPy version 2021.1.3-2021.2.3Python to JavaScript Crib Sheet Compiled by Wakefield Morys-Carter, Oxford Brookes UniversityPlease share widely and follow Psych\_Stats on twitter. PsychoPy 2021 is a major update with several new features. When...

---

<div class="post-metadata">

**Author:** ![marayuso](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@marayuso](https://discourse.psychopy.org/u/marayuso)\
**Post date:** [March 18, 2022, 9:11am UTC](https://discourse.psychopy.org/t/problem-with-java-in-pavlovia/28070/3 "2022-03-18T09:11:58Z")

</div>

I tried like this:

![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/9/e/9e5ab07a5a5740ca15d3f46cfa9af2f91946b97e.png)

And now I have this problem:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/5/c/5c3f3c1385552fec7718d4529ad32f20bbb984f4.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [March 18, 2022, 9:22am UTC](https://discourse.psychopy.org/t/problem-with-java-in-pavlovia/28070/4 "2022-03-18T09:22:30Z")

</div>

Are your testing a JS version of pandas?

---

<div class="post-metadata">

**Author:** ![marayuso](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@marayuso](https://discourse.psychopy.org/u/marayuso)\
**Post date:** [March 18, 2022, 9:31am UTC](https://discourse.psychopy.org/t/problem-with-java-in-pavlovia/28070/5 "2022-03-18T09:31:54Z")

</div>

Like this?

![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/0/1/0122fc1a00913e55c00f3cef9594c7bcc703063c.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [March 18, 2022, 10:04am UTC](https://discourse.psychopy.org/t/problem-with-java-in-pavlovia/28070/6 "2022-03-18T10:04:24Z")

</div>

At this point I’m going to assume that the answer to my question is no.

Your issue is that pandas is a python library and doesn’t work online.

My code snippets have information about how to import spreadsheets using Trial Handlers in code

> **[PsychoPy Code Component Snippets](https://docs.google.com/document/d/1kclYKgpbOCT3X8_O5pQOEIQHvD6zqMyxz3IKv3-K73I/edit#heading=h.cvmjmfh6e7dz)**
>
> PsychoPy version 2020.2.10Code Component Snippets Compiled by Wakefield Morys-Carter, Oxford Brookes UniversityPlease share widely and follow Psych\_Stats on twitter. Code components should be Auto Py-&gt;JS unless code has been added to the PsychoJS...

My Trial Switching demo uses this method

> [@PsychoPy Online Demos](https://discourse.psychopy.org/t/psychopy-online-demos/22319#trial-switching-codehttpsgitlabpavloviaorgvesprtrial-switching-try-ithttpsrunpavloviaorgvesprtrial-switching-discussion-threadhttpsdiscoursepsychopyorgthow-to-implement-equal-no-of-switch-and-non-switch-trials26703-25):
>
> If you have routines or experiments that are likely to be useful to others, please create a post in this thread, editing your post to add new demos so there is one post per creator. Ideally set your demos so they can be tested without consuming a credit (if you don’t have a site license) by adding a final routine that can’t end, disabling save incomplete results and adding a small number of credits. Please do not discuss the demos in this thread or create more than one post unless you have a la…
