This problem has plagued me since I started using Pyschopy. So It’d be great to understand this problem.
I often run experiments where I use Qualtrix to randomly distribute people to different Psychopy experiments - each experiment representing a different condition in a between subjects design. As such these different experiments are often very similar and just have a small difference.
Thus when coding, I will usually write the experiment for condition A , then copy this entire folder and rename it for Condition B and then make the required changes for this condition.
When I upload these two experiment to Pavlovia, often Experiment B will just overwrite the existing Experiment A on Pavlovia. I have spent ages mucking around trying to figure out how Pavlovia recognises that the current upload (instigated by the ‘Sync’ button) is a NEW and different experiment to what was there previously. This process is fraught and I usually get there by mucking around - but I have no clear idea of what the ‘marker’ is that Pavlovia uses to detect a new experiment - or match with a current one.
I have tried changing the name of the local folder of the experiment, the name of experiment file itself, and the experiment name within the Psychopy application (accessed via the cog icon).
None of these approaches reliably work.
So… what change should I make to a experiment - in order for Pavlovia to see it as a new experiment and not write over another (similar in structure), existing experiment.
So I have discovered the ‘New’ item in the "pavlovia.org’ menu. Which has a ‘Create new project’ button.
Perhaps this is what I should use when starting a new project?
Anyway I have now tried this, wtice - but it’s throwing an error. Text below.
Any ideas?
Thanks.
Traceback (most recent call last):
File “urllib3/connectionpool.pyc”, line 384, in _make_request
File “”, line 2, in raise_from
File “urllib3/connectionpool.pyc”, line 380, in _make_request
File “http/client.pyc”, line 1331, in getresponse
File “http/client.pyc”, line 297, in begin
File “http/client.pyc”, line 258, in _read_status
File “socket.pyc”, line 586, in readinto
File “urllib3/contrib/pyopenssl.pyc”, line 298, in recv_into
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/requests/adapters.py”, line 449, in send
File “urllib3/connectionpool.pyc”, line 638, in urlopen
File “urllib3/util/retry.pyc”, line 367, in increment
File “urllib3/packages/six.pyc”, line 686, in reraise
File “urllib3/connectionpool.pyc”, line 600, in urlopen
File “urllib3/connectionpool.pyc”, line 386, in _make_request
File “urllib3/connectionpool.pyc”, line 306, in _raise_timeout
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘gitlab.pavlovia.org’, port=443): Read timed out. (read timeout=3)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/pavlovia_ui/project.py”, line 151, in submitChanges
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/projects/pavlovia.py”, line 325, in createProject
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/gitlab/exceptions.py”, line 251, in wrapped_f
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/gitlab/mixins.py”, line 204, in create
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/gitlab/init.py”, line 604, in http_post
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/gitlab/init.py”, line 481, in http_request
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/requests/sessions.py”, line 646, in send
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/requests/adapters.py”, line 529, in send
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host=‘gitlab.pavlovia.org’, port=443): Read timed out. (read timeout=3)
@jon or @apitiot could probably give you a definitive answer, but my understanding is that an ‘experiment’ just corresponds to a single GitLab repository. So if you are uploading things to the same repository, then it would not be recognized as a new experiment. I assume the “create new project” button in PsychoPy tries to create a new repository on GitLab. The error you’re getting is just that Pavlovia is taking too long to respond, probably related to the recent issues Pavlovia has been having with bot traffic (there are several posts around the forum about this), so try it at a different time of day or wait a couple days and see if it works then.
Worst case you can manually force it to make a new experiment by going to https://gitlab.pavlovia.org/ and clicking “new project” there, which will create a blank repository where you can manually upload a PsychoPy experiment generated by the builder. I don’t think you could get PsychoPy to sync with a repository you created this way, but you can use the “generate JS code” button and then upload the file it creates through a simple drag-and-drop (along with any media files). When you go to your Pavlovia dashboard it will then appear in your experiments and you can manage it normally.
@Dan_Conway I think the issue you’re seeing is that when you “copy the entire folder to a new location” you copy a hidden file inside it called .git. That folder contains all the history of the project but also information for PsychoPy about the location/name of the project on the server. So, as far as PsychoPy is concerned, you’ve just moved your project locally but we can still sync to the same remote location.
There are at least two solutions:
create a new folder and move the contents of the original to that rather than duplicating the folder itself. When you do that you usually don’t copy the hidden .git folder. By turning on view hidden files you can check whether it’s moved with you
OR given that your experiment changes only a little between different runs, the most efficient thing to do would be to have a single experiment but use an Experiment Settings variable to control that small change:
add a variable to your Experiment Settings (something like “group” but call it whatever makes most sense) and in your experiment use some code like if expInfo["group"] == "group1": ...
then in your url to the experiment you can add ?group="group1" to the end, which will control which group the participant is assigned to
The second approach involves more cognitive effort but the advantage is that you don’t end up with a proliferation of folder/projects/experiments that you have to keep track of later
Ok. So, following a suggestion from @Becca, I tried using the Builder window: Pavlovia menu > New dialog box – but this time not including a fullstop in the Project name. And… it enabled the OK button. However, when I then clicked it, Pyschopy thought for a while – nothing appeared in the runner – and then the dialog disappeared and I was returned to the main screen. Going into Pavlovia, I now see a project with the name I just entered. Great. BUT… when I now hit ‘Sync’ I get the following error message:
<image 1>
???
Questions:
Is the Pavlovia menu > Sync the same thing as the icon in the top of builder? Does the ‘Sync’ button – if no project has been set up – do the same things as ‘Pavlovia menu > New’? And is this the same thing as ‘Builder Icon ‘Info/View Details’ > ‘Project Info’ dialog box: ‘+ Create’?
Do I need to somehow log in (or connect somehow) specifically within PsychoPy to Pavlovia? It would seem I can create a project on Pavlovia – but then syncing does not find that project.
Using the ‘Builder Icon ‘Info/View Details’ > ‘Project Info’ dialog box: ‘+ Create’ – does same thing as above – I get a spinning wheel progress incidator for a few seconds – but nothing appears in the runner. Then the dialog box looks like this:
<image 2>
Great. Now when I press ‘Sync’ in this dialog box – still open – NOW it seems to work! Including feedback within the Runner window.
BUT…
When I go to pavlovia, open the project and ‘View Code’. It seems to have some older versions of files here – from 19 hours ago. Comments are from uploads I was trying to do yesterday. Hmmmm…
OK – NEW APPROACH.
Based on the suggestion from @jon above I have now tried manually creating a new folder structure and copying only the absolutely necessary files across. Booted the project, used the info/View details dialog box and then clicked ‘+ Create’, then ’Sync’ and this all seemed to work. (also avoided fullstops in filename). On Pavlovia a new project is now there – and the view code button shows the comments I made during this sync operation. Great. BUT… when I now try to pilot the experiment, I get:
<image 3>
Note: Pavlovia appears to think that I am logged in. I can view my experiments, I have a ‘Log out’ option at the top of the screen etc…
This is ridiculous.
Can anyone answer any of these questions or suggest a way forward.
Is the Pavlovia menu > Sync the same thing as the icon in the top of builder?
yes
Does the ‘Sync’ button – if no project has been set up – do the same things as ‘Pavlovia menu > New’? And is this the same thing as ‘Builder Icon ‘Info/View Details’ > ‘Project Info’ dialog box: ‘+ Create’?
Yes, if you’re creating the project within PsychoPy (rather than on the website) then all these routes will automatically go through the same steps for you
Do I need to somehow log in (or connect somehow) specifically within PsychoPy to Pavlovia? It would seem I can create a project on Pavlovia – but then syncing does not find that project.
You do need to log into Pavlovia from PsychoPy, but I believe you have done already
BUT… when I now try to pilot the experiment, I get:
<image 3>
I don’t know how you tried to access the URL to pilot your study but my guess is that it wasn’t set to be in piloting mode or you hadn’t pressed the button to get a pilot URL for this study. You need to set the status to Piloting and then press the Pilot button (next to View Code) on your dashboard for this project as in the screenshot below: