Skip to content

ci: removed installation unnecessary apt dependencies#26

Closed
ErikBjare wants to merge 2 commits into
NeuroTechX:masterfrom
ErikBjare:dev/ci-fix
Closed

ci: removed installation unnecessary apt dependencies#26
ErikBjare wants to merge 2 commits into
NeuroTechX:masterfrom
ErikBjare:dev/ci-fix

Conversation

@ErikBjare

@ErikBjare ErikBjare commented Nov 18, 2020

Copy link
Copy Markdown
Collaborator

Turns out the step didn't run (the startsWith(os.runner, 'ubuntu') should have been startsWith(os.runner, 'linux')), but since things work fine without it we might as well drop it altogether.

Edit: I also added a CI badge to the README.

@jnaulty

jnaulty commented Dec 4, 2020

Copy link
Copy Markdown
Member

I was taking a look at this PR, and tried to do a fresh install of eeg-notebooks

Some packages might actually be necessary to run. Notice that the test github action does not actually run any tests. pip install -e . works fine on my system, but eegnb runexp does not.
So, the current PR is 'fine' in it's current form.
The real problem isn't the unnecessary apt dependencies, it's the lack of an initial test that might identify installation issues.

I am trying to install eeg-notebooks on a fresh ubuntu 20.04 image and am having issues that seem related to psychopy.

Based on the psychopy documentation for installing linux, it looks like there are at least two manual steps required for this to work on:

  1. install wxPython
  2. install a few debian packages

ref: https://www.psychopy.org/download.html#linux

Debugging Info Below

The initial error I am receiving is:

(venv) ➜  eeg-notebooks git:(master) ✗ eegnb run_notebooks.py 
Traceback (most recent call last):
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/venv/bin/eegnb", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3252, in <module>
    def _initialize_master_working_set():
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'cryptography>=1.3.4; extra == "security"' distribution was not found and is required by requests

If I install additional packages with pip install -r requirements.txt it installs two additional packages:

Installing collected packages: cryptography, pyOpenSSL
Successfully installed cryptography-3.2.1 pyOpenSSL-20.0.0

Then the following error:

(venv) ➜  eeg-notebooks git:(master) ✗ eegnb runexp          
Traceback (most recent call last):
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/venv/bin/eegnb", line 11, in <module>
    load_entry_point('eeg-notebooks', 'console_scripts', 'eegnb')()
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/eegnb/cli/__main__.py", line 73, in main
    cli = CLI(args.command)
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/eegnb/cli/cli.py", line 9, in __init__
    getattr(self, command)()
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/eegnb/cli/cli.py", line 41, in runexp
    from .utils import run_experiment
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/eegnb/cli/utils.py", line 5, in <module>
    from eegnb.experiments.auditory_oddball import auditoryaMMN
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/eegnb/experiments/auditory_oddball/auditoryaMMN.py", line 9, in <module>
    from psychopy import visual, core, event, sound
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/venv/lib/python3.8/site-packages/psychopy/sound/__init__.py", line 99, in <module>
    raise exceptions.DependencyError(
psychopy.exceptions.DependencyError: No sound libs could be loaded. Tried: ['sounddevice', 'PTB', 'pyo', 'pygame']
Check whether the necessary sound libs are installed
0.9089  WARNING         sounddevice audio lib was requested but not loaded: sounddevice not working
0.9103  WARNING         PTB audio lib was requested but not loaded: psychtoolbox audio failed to import
0.9108  WARNING         pyo audio lib was requested but not loaded: ModuleNotFoundError("No module named 'pyo'")
0.9112  WARNING         pygame audio lib was requested but not loaded: ModuleNotFoundError("No module named 'pygame'")

I install pyo and pygame, but still receive an error

(venv) ➜  eeg-notebooks git:(master) ✗ eegnb runexp
pygame 2.0.0 (SDL 2.0.12, python 3.8.5)
Hello from the pygame community. https://www.pygame.org/contribute.html

WxPython is not found for the current python version.
Pyo will use a minimal GUI toolkit written with Tkinter (if available).
This toolkit has limited functionnalities and is no more
maintained or updated. If you want to use all of pyo's
GUI features, you should install WxPython, available here:
http://www.wxpython.org/

Traceback (most recent call last):
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/venv/bin/eegnb", line 11, in <module>
    load_entry_point('eeg-notebooks', 'console_scripts', 'eegnb')()
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/eegnb/cli/__main__.py", line 73, in main
    cli = CLI(args.command)
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/eegnb/cli/cli.py", line 9, in __init__
    getattr(self, command)()
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/eegnb/cli/cli.py", line 41, in runexp
    from .utils import run_experiment
  File "/home/jnaulty/github.com/neurotechx/eeg-notebooks/eegnb/cli/utils.py", line 10, in <module>
    import h5py
ModuleNotFoundError: No module named 'h5py'
0.9997  WARNING         sounddevice audio lib was requested but not loaded: sounddevice not working
1.0008  WARNING         PTB audio lib was requested but not loaded: psychtoolbox audio failed to import
1.1016  WARNING         For experiments that use audio stimuli, timing will be much better if you upgrade your PsychoPy installation to a 64bit Python3 installation and use the PTB backend.

after installing that, we finally get to the wxpython error

(venv) ➜  eeg-notebooks git:(master) ✗ eegnb runexp    
pygame 2.0.0 (SDL 2.0.12, python 3.8.5)
Hello from the pygame community. https://www.pygame.org/contribute.html

WxPython is not found for the current python version.
Pyo will use a minimal GUI toolkit written with Tkinter (if available).
This toolkit has limited functionnalities and is no more
maintained or updated. If you want to use all of pyo's
GUI features, you should install WxPython, available here:
http://www.wxpython.org/

0.9734  WARNING         sounddevice audio lib was requested but not loaded: sounddevice not working
0.9745  WARNING         PTB audio lib was requested but not loaded: psychtoolbox audio failed to import
1.0757  WARNING         For experiments that use audio stimuli, timing will be much better if you upgrade your PsychoPy installation to a 64bit Python3 installation and use the PTB backend.

@JohnGriffiths

Copy link
Copy Markdown
Collaborator

dang.

@jnaulty

jnaulty commented Dec 4, 2020

Copy link
Copy Markdown
Member

installing wxPython worked ;)
I had to install gtk3: sudo apt install libgtk-3-dev
Then reinstalled wxPython: pip install --no-cache wxPython (this took about ~15 minutes on my computer to recompile everything with the gtk3 bindings).

@jnaulty

jnaulty commented Dec 6, 2020

Copy link
Copy Markdown
Member

Closing because #54 is in a state to merge and resolves issues related to building + testing eeg-notebooks on linux

@jnaulty jnaulty closed this Dec 6, 2020
@ErikBjare

Copy link
Copy Markdown
Collaborator Author

@jnaulty Good call, and nice work on #54!

I cherry-picked 2cc53f7 directly onto master.

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

Successfully merging this pull request may close these issues.

3 participants