Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to install on Debian 11 with conda #787

Closed
derNarr opened this issue May 10, 2023 · 5 comments
Closed

fails to install on Debian 11 with conda #787

derNarr opened this issue May 10, 2023 · 5 comments

Comments

@derNarr
Copy link

derNarr commented May 10, 2023

Hi all,
somehow I cannot install opensesame in a working condition on a debian bulls-eye computer.
Any help on installing it is appreciated.
I followed the instructions on with some modifications as explained below:

https://osdoc.cogsci.nl/3.3/download/

What I did:

conda create -n opensesame python=3.8
conda activate opensesame
conda config --add channels cogsci --add channels conda-forge
conda install pyqode.core
conda install pyqode.python
conda install ipython
conda install rapunzel
conda install psychopy
conda install opensesame opensesame-extension-osweb opensesame-plugin-psychopy
pip install soundfile pygame yolk3k opensesame-extension-osf python-qtpip http://files.cogsci.nl/expyriment-0.10.0+opensesame2-py3-none-any.whl

I opted for Python 3.8 as 3.10 seems to give even more errors. Furthermore, I installed some of the packages step by step, as the dependency resolution seems to be better this way.

After installing opensesame this way, starting it, still gives some error messages, which can be removed by installing the following two packages:

conda install PyQtWebEngine jupyter

When I now start opensesame in this environment, the following results are printed to the terminal:

[2023-05-10 10:31:01,949:qtopensesame:499:WARNING] no translation file found for [D
[2023-05-10 10:31:02,053:qtplugin_manager:68:INFO] dynamically creating plugin gui class for notepad
[2023-05-10 10:31:02,113:plugin_manager:189:WARNING] found deprecated old-style plugin OpenScienceFramework in PATH_TO_MINICONDA/envs/opensesame/share/opensesame_extensions/OpenScienceFramework
[2023-05-10 10:31:02,113:plugin_manager:189:WARNING] found deprecated old-style plugin package_manager in PATH_TO_MINICONDA/envs/opensesame/share/opensesame_extensions/package_manager
[2023-05-10 10:31:02,119:_base_extension:50:WARNING] the info keyword is deprecated
[2023-05-10 10:31:02,869:OpenScienceFramework:884:WARNING] Could not parse retrieved OSF settings: Expecting value: line 1 column 1 (char 0)
[2023-05-10 10:31:02,869:OpenScienceFramework:886:WARNING] Using cached OSF settings instead
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/multiprocessing/spawn.py", line 125, in _main
    prepare(preparation_data)
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/multiprocessing/spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/runpy.py", line 265, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "PATH_TO_MINICONDA/envs/opensesame/bin/opensesame", line 6, in <module>
    from libqtopensesame.__main__ import opensesame
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/site-packages/libqtopensesame/__main__.py", line 31, in <module>
    multiprocessing.set_start_method(
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/multiprocessing/context.py", line 243, in set_start_method
    raise RuntimeError('context has already been set')
RuntimeError: context has already been set
done!
done!
done!
done!
done!
done!

Still opensesame opens up and I can navigate and click through it. Only, when I try to run the default experiment, I always get the error:

Information:

Operating System: linux
OpenSesame: 4.0.0a33
Python: 3.8.16
Don't show me this message!

(...)
Error message:

Traceback (most recent call last):
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/site-packages/libopensesame/item_store.py", line 287, in __getitem__
    return self.__items__[name]
KeyError: 'unknown'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/site-packages/libqtopensesame/widgets/webbrowser.py", line 92, in acceptNavigationRequest
    self.parent().command(url)
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/site-packages/libqtopensesame/widgets/webbrowser.py", line 257, in command
    self.experiment.items[cmd[1]].open_tab(phase=cmd[2], args=cmd[3:])
  File "PATH_TO_MINICONDA/envs/opensesame/lib/python3.8/site-packages/libopensesame/item_store.py", line 289, in __getitem__
    raise ItemDoesNotExist(name)
libopensesame.exceptions.ItemDoesNotExist: 
Error: ItemDoesNotExist

Item unknown does not exist

This error occurred in the unknown phase of item unknown.

Before the error occurs I put in a subject number and select a file to store the results.

This happens regardless of which backend I use (psycho, xpyriment, legacy, osweb).

Any ideas how to fix this?
Best, Tino

@derNarr
Copy link
Author

derNarr commented May 10, 2023

Ok, after manually downgrading opensesame to 3.3 and reinstalling pyqode.qt and starting opensesame with OPENSESAME_MULTIPROCESSING_METHOD=fork, opensesame seems to work and starts the default experiment.

(Still within the conda environment created above.)

conda install opensesame=3.3
conda install pyqode.qt
export OPENSESAME_MULTIPROCESSING_METHOD=fork && opensesame

The last line might be needed as I am on a computer with a hybrid intel/NVIDIA graphic chip as describe in Issue #782 .

opensesame starts with the following warning messages:

[2023-05-10 10:52:27,566:theme:63:WARNING] theme 'None' does not exist, using 'default'
[2023-05-10 10:52:28,489:OpenScienceFramework:884:WARNING] Could not parse retrieved OSF settings: Expecting value: line 1 column 1 (char 0)
[2023-05-10 10:52:28,489:OpenScienceFramework:886:WARNING] Using cached OSF settings instead
done!
done!
done!
done!
done!
done!

@derNarr
Copy link
Author

derNarr commented May 10, 2023

Ok, hopefully last comment on this issue:

conda install opensesame-extension-osweb --force-reinstall

I can start opensesame normally with:

opensesame

And now I can select the different backends and run the experiment in an external browser.

Two possible things, where I tripped over:

  1. in the cogsci conda channel opensesame version 4.0.0a33 is shipped
  2. the way the channels are added conda-forge gets the highest priority as it is added. Instead of using --add, --append might be the better option, i. e. conda config --append channels cogsci --append channels conda-forge

Should the download documentation be adjusted accordingly?

https://osdoc.cogsci.nl/3.3/download/

@smathot
Copy link
Collaborator

smathot commented May 11, 2023

Good to see that you figured it out! I'm closing this issue because it's not a bug in the OpenSesame source code as such, but rather an installation issue.

in the cogsci conda channel opensesame version 4.0.0a33 is shipped (...) Should the download documentation be adjusted accordingly?

OpenSesame 4.0 will be released soon, so the conda packaging is already tailored towards that release. If you're starting a new project, I would recommend already with the 4.0 prerelease now:

@smathot smathot closed this as completed May 11, 2023
@derNarr
Copy link
Author

derNarr commented May 11, 2023

Should I open another issue for the documentation? I feel the following line is missing in the documentation

conda install pyqode.core pyqode.python
conda install ipython jupyter PyQtWebEngine qtconsole wxPython

To me the install commands should read:

conda config --add channels conda-forge --add channels cogsci
conda install pyqode.core pyqode.python
conda install ipython jupyter PyQtWebEngine qtconsole wxPython cython pyglet pyopengl
conda install opensesame opensesame-extension-osweb opensesame-extension-updater opensesame-plugin-psychopy rapunzel pygaze

Following the instructions as mentioned in https://osdoc.cogsci.nl/4.0/download/#anaconda-cross-platform
leads to the following error message after running the pip command:

Collecting wxPython>=4.1.1
  Downloading wxPython-4.2.0.tar.gz (71.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.0/71.0 MB 5.9 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-xt_5wrme/wxpython_3a321aecbaef4c59b28ac8836ba4ad42/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-xt_5wrme/wxpython_3a321aecbaef4c59b28ac8836ba4ad42/buildtools/config.py", line 30, in <module>
          from attrdict import AttrDict
      ModuleNotFoundError: No module named 'attrdict'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

I could fix this error by running:

conda install wxPython

which installed wxPython version 4.1.1, which is the minimum at the moment for Psychopy.

Overall, I feel the installation script should pull in more dependencies over conda and less over pip, like cython, pyglet, pyopengl.

After installing the pip dependencies successfully, opensesame does not start up with the following error:

    raise QtBindingsNotFoundError from None
qtpy.QtBindingsNotFoundError: No Qt bindings could be found

After installing:

conda install PyQtWebEngine

opsensesame starts up, but throws the following error in the terminal:

ModuleNotFoundError: No module named 'qtconsole'

after installing

conda install qtconsole

Everything seems to work fine, except that starting an experiment runs into an "unknown" error for the psychopy, the pygame, and the xpyriment backend. OSWeb as a backend works.

I am unsure, if the pyqode.qt package is needed.

In the current state the installation on Debian 11 is broken. It might also be fine do update the dependencies according to the missing packages above. What is the reason to not pull in pyqode.... and the other packages as dependencies for opensesame?

@smathot
Copy link
Collaborator

smathot commented May 12, 2023

Thanks for this! Indeed the qtconsole, pyqtwebengine, and wxpython packages also needed to be conda-installed. I update the conda installation instructions. If you have further suggestions for the documentations, then it's best to open it on the documentation repo:

smathot added a commit that referenced this issue May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants