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

OSError: [Errno 8] Exec format error with .run_klusta() #69

Open
fvcoen opened this issue Apr 28, 2020 · 0 comments
Open

OSError: [Errno 8] Exec format error with .run_klusta() #69

fvcoen opened this issue Apr 28, 2020 · 0 comments

Comments

@fvcoen
Copy link

fvcoen commented Apr 28, 2020

Hello again,

Following the successful installation of klustakwik2 on my system, I'm running into an issue when trying to follow the "Getting started with SpikeInterface" tutorial.

At first things seem to work, with ss.installed_sorter_listshowing that klusta is install properly, but when I reach sorting_KL = ss.run_klusta(recording=recording_cmr), the system throws an error:

RUNNING SHELL SCRIPT: /var/folders/36/95fz5r4d181c_hfh6014lvnr0000gn/T/tmp_shellscriptq0bv8f97/script.bat

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-14-cb0b9d22eedf> in <module>
----> 1 sorting_KL = ss.run_klusta(recording=recording_cmr)

~/Code/SpikeInterface/lib/python3.7/site-packages/spikesorters/sorterlist.py in run_klusta(*args, **kargs)
    100 
    101 def run_klusta(*args, **kargs):
--> 102     return run_sorter('klusta', *args, **kargs)
    103 
    104 

~/Code/SpikeInterface/lib/python3.7/site-packages/spikesorters/sorterlist.py in run_sorter(sorter_name_or_class, recording, output_folder, delete_output_folder, grouping_property, parallel, verbose, **params)
     51                          parallel=parallel, verbose=verbose, delete_output_folder=delete_output_folder)
     52     sorter.set_params(**params)
---> 53     sorter.run()
     54     sortingextractor = sorter.get_result()
     55 

~/Code/SpikeInterface/lib/python3.7/site-packages/spikesorters/basesorter.py in run(self)
    100         if not self.parallel:
    101             for i, recording in enumerate(self.recording_list):
--> 102                 self._run(recording, self.output_folders[i])
    103         else:
    104             # run in threads

~/Code/SpikeInterface/lib/python3.7/site-packages/spikesorters/klusta/klusta.py in _run(self, recording, output_folder)
    142 
    143         shell_cmd = ShellScript(shell_cmd, keep_temp_files=True)
--> 144         shell_cmd.start()
    145 
    146         retcode = shell_cmd.wait()

~/Code/SpikeInterface/lib/python3.7/site-packages/spikesorters/utils/shellscript.py in start(self)
     59         print('RUNNING SHELL SCRIPT: ' + cmd)
     60         self._start_time = time.time()
---> 61         self._process = subprocess.Popen(cmd)
     62 
     63     def wait(self, timeout=None) -> Optional[int]:

/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
    798                                 c2pread, c2pwrite,
    799                                 errread, errwrite,
--> 800                                 restore_signals, start_new_session)
    801         except:
    802             # Cleanup if the child failed starting.

/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
   1549                         if errno_num == errno.ENOENT:
   1550                             err_msg += ': ' + repr(err_filename)
-> 1551                     raise child_exception_type(errno_num, err_msg, err_filename)
   1552                 raise child_exception_type(err_msg)
   1553 

OSError: [Errno 8] Exec format error: '/var/folders/36/95fz5r4d181c_hfh6014lvnr0000gn/T/tmp_shellscriptq0bv8f97/script.bat'

I've tried to chmod+x on the script, as suggested here but nothing changed. When I run env I get SHELL=/bin/bash which seems correct.

Note that I'm running everything in a venv.

Note too sure what else to try, but if anyone has encountered this before, any tips would be greatly appreciated :)

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

1 participant