I remove the import for random:
import random
That error was eliminated. Now this error remains:
Failed to load resource: the server responded with a status of 404 () pvtexample/lib/psychojs-2024.2.4.css:1
This appears to be written to the .js automatically when no version is specified:
Rolling back to an earlier version of PsychoPy here:
Creates fatal errors locally
Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/app/builder/builder.py”, line 1389, in runFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/app/runner/runner.py”, line 642, in runLocal
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/scripts/psyexpCompile.py”, line 78, in generateScript
psychopy.scripts.psyexpCompile.LegacyScriptError: Error: Script compile exited with code 1. Traceback:
2025-03-12 11:10:35.223 python[43424:13188610] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/zf/0m0fm2gj4jv2dq4738ym08600000gn/T/org.opensciencetools.psychopy.savedState
Traceback (most recent call last):
File “runpy.pyc”, line 196, in _run_module_as_main
File “runpy.pyc”, line 86, in _run_code
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/scripts/psyexpCompile.py”, line 229, in
compileScript(args.infile, args.version, args.outfile)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/scripts/psyexpCompile.py”, line 219, in compileScript
thisExp = _getExperiment(infile, version)
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.10/psychopy/scripts/psyexpCompile.py”, line 146, in _getExperiment
from psychopy.app.builder import experiment
File “/Users/mycomputer/.psychopy3/versions/psychopy/app/builder/init.py”, line 5, in
from .builder import BuilderFrame
File “/Users/mycomputer/.psychopy3/versions/psychopy/app/builder/builder.py”, line 59, in
from .dialogs import (DlgComponentProperties, DlgExperimentProperties,
File “/Users/mycomputer/.psychopy3/versions/psychopy/app/builder/dialogs/init.py”, line 29, in
from .dlgsCode import DlgCodeComponentProperties, CodeBox
File “/Users/mycomputer/.psychopy3/versions/psychopy/app/builder/dialogs/dlgsCode.py”, line 25, in
from psychopy.app.coder.codeEditorBase import BaseCodeEditor
File “/Users/mycomputer/.psychopy3/versions/psychopy/app/coder/init.py”, line 8, in
from .coder import CoderFrame, BaseCodeEditor # pylint: disable=W0401
File “/Users/mycomputer/.psychopy3/versions/psychopy/app/coder/coder.py”, line 47, in
from psychopy.app.coder.fileBrowser import FileBrowserPanel
File “/Users/mycomputer/.psychopy3/versions/psychopy/app/coder/fileBrowser.py”, line 21, in
import imghdr
ModuleNotFoundError: No module named ‘imghdr’
These all appear to be related, as the line that defines the library pull/location also is not found at launch time?