Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Unexpected error: AttributeError: 'list' object has no attribute 'copy'

Hi,

I've experiencing an odd error. Here the error message of just running the extended template:

The experiment did not finish normally for the following reason:


Unexpected error
Details


item-stack: experiment[run].practice_loop[run]
exception type: AttributeError
exception message: 'list' object has no attribute 'copy'
time: Fri Jul 19 18:41:41 2019
Traceback (also in debug window)


  File "C:\OpenSesame3-2-8\OpenSesame\lib\site-packages\libqtopensesame\misc\process.py", line 157, in run
    exp.run()
  File "C:\OpenSesame3-2-8\OpenSesame\lib\site-packages\libopensesame\experiment.py", line 456, in run
    self.items.execute(self.var.start)
  File "C:\OpenSesame3-2-8\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 103, in execute
    self.run(name)
  File "C:\OpenSesame3-2-8\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
    self[name].run()
  File "C:\OpenSesame3-2-8\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 51, in run
    self.experiment.items.run(_item)
  File "C:\OpenSesame3-2-8\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
    self[name].run()
  File "C:\OpenSesame3-2-8\OpenSesame\lib\site-packages\libopensesame\loop.py", line 341, in run
    self.live_dm = self._create_live_datamatrix()
  File "C:\OpenSesame3-2-8\OpenSesame\lib\site-packages\libopensesame\loop.py", line 209, in _create_live_datamatrix
    dm <<= operations.shuffle(src_dm)[:i]
  File "C:\OpenSesame3-2-8\OpenSesame\lib\site-packages\datamatrix\operations.py", line 517, in shuffle
    _rowid = Index(obj._rowid)
  File "C:\OpenSesame3-2-8\OpenSesame\lib\site-packages\datamatrix\_datamatrix\_index.py", line 54, in __init__
    self._l = start._l.copy()
AttributeError: 'list' object has no attribute 'copy'

This occurs for any of my scripts including just running plain OpenSesame templates.

I am using OpenSesame 3.2.8. .zip version. I only experienced this error after deinstalling Anaconda with Python 2 and reinstalling it with Python 3 and using Visual Studio Code / PyCharm. Not quite sure how these are related and why it also affects the standalone version of OpenSesame (I expect it comes with its own Python packages) but I just thought it might help figuring out what the error is...

Thanks,

Michel

Comments

  • Hi Michel,

    My guess is that, for some reason due to the Anaconda installation/ deinstallation , numpy is broken on your system. In addition, there seems to be a bug in older versions of DataMatrix (still shipped with OpenSesame 3.2.8) that break when numpy is not available, even it should fall back to a non-numpy system.

    Could that be it? What happens if you try to import numpy in the debug window? If that's indeed it, then as a workaround, you could either re-install numpy or upgrade python-datamatrix to the latest version.

    Cheers!

    Sebastiaan

    Thanked by 1Michif

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • Good call! I cannot import numpy or any module that uses numpy in the debug window. After using print(os.environ['PATH']) in the debug window, I found the path C:\Users\miche\AppData\Roaming\Python\Python27\site-packages\numpy\.libs. And low and behold, there was an old python 2.7 numpy module chilling on my hard drive. Seems like OpenSesame is searching default for some python site-package folder and prefers python 2.7? Either way, removing this folder seems to have fixed it.

    Thanks!


    Now that we are kinda talking about it: Do you plan to implement an option to choose the python environment in which you want to run Open Sesame (standalone) in?

  • > Now that we are kinda talking about it: Do you plan to implement an option to choose the python environment in which you want to run Open Sesame (standalone) in?

    I have been thinking about something along those lines, yes, in the context of a slightly different project that I've been working on. But it's tricky (though not impossible), because OpenSesame is obviously running in a Python environment already. So we'll see.

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

Sign In or Register to comment.