file is being used by another process

59 views
Skip to first unread message

Pedro Lagomarsino

unread,
Jul 1, 2019, 4:55:24 AM7/1/19
to phy-users
Hi all,

I have phy2 working finely in an ubuntu machine, I now installed it in a machine with windows together with Spyking-circus. I run the spike sorting with no problem but when I try to open the phy template-gui I persistently get the following error.

(phy2) C:\Users\plagomarsino\work\Thalamus_project\spyke-test\hybrid_10sec\hybri
d_10sec
.GUI>phy template-gui params.py
←[31m09:51:55.332 [E] __init__:58          An error has occurred (PermissionErro
r
): [WinError 32] The process cannot access the file because it is being used by
 another process
: 'C:\\Users\\plagomarsino\\work\\Thalamus_project\\spyke-test\\
hybrid_10sec.dat'

Traceback (most recent call last):
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\runpy.py", line 193, in _r
un_module_as_main
   
"__main__", mod_spec)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\runpy.py", line 85, in _ru
n_code
   
exec(code, run_globals)
 
File "C:\Users\plagomarsino\anaconda3\envs\phy2\Scripts\phy.exe\__main__.py",
line
9, in <module>
    sys
.exit(phycli())
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\click\core.p
y"
, line 764, in __call__
   
return self.main(*args, **kwargs)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\click\core.p
y"
, line 717, in main
    rv
= self.invoke(ctx)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\click\core.p
y"
, line 1137, in invoke
   
return _process_result(sub_ctx.command.invoke(sub_ctx))
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\click\core.p
y"
, line 956, in invoke
   
return ctx.invoke(self.callback, **ctx.params)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\click\core.p
y"
, line 555, in invoke
   
return callback(*args, **kwargs)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\click\decora
tors.py"
, line 17, in new_func
   
return f(get_current_context(), *args, **kwargs)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\phy\apps\__i
nit__.py"
, line 129, in cli_template_gui
    template_gui
(params_path, clear_cache=clear_cache)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\phy\apps\tem
plate\gui.py"
, line 1101, in template_gui
    controller
= TemplateController(**get_template_params(params_path), clear_ca
che
=clear_cache)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\phy\apps\tem
plate\gui.py"
, line 153, in __init__
   
self.model = TemplateModel(dat_path, **kwargs) if not model else model
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\phylib\io\mo
del.py"
, line 239, in __init__
   
self._load_data()
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\phylib\io\mo
del.py"
, line 302, in _load_data
   
self.traces = self._load_traces(self.channel_mapping)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\phylib\io\mo
del.py"
, line 435, in _load_traces
   
for path in paths]
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\phylib\io\mo
del.py"
, line 435, in <listcomp>
   
for path in paths]
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\phylib\io\mo
del.py"
, line 101, in load_raw_data
   
return _dat_to_traces(path, n_channels=n_channels_dat, dtype=dtype, offset=o
ffset
)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\phylib\io\mo
del.py"
, line 84, in _dat_to_traces
   
return np.memmap(dat_path, dtype=dtype, shape=(n_samples, n_channels), offse
t
=offset)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\site-packages\numpy\core\m
emmap.py"
, line 275, in __new__
   
self.filename = filename.resolve()
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\pathlib.py", line 1141, in
 resolve
    s
= self._flavour.resolve(self, strict=strict)
 
File "c:\users\plagomarsino\anaconda3\envs\phy2\lib\pathlib.py", line 193, in
resolve
    s
= self._ext_to_normal(_getfinalpathname(s))
PermissionError: [WinError 32] The process cannot access the file because it is
being used
by another process: 'C:\\Users\\plagomarsino\\work\\Thalamus_project\
\spyke-test\\hybrid_10sec.dat'

←[0m

It would seem like the data file is being used by another process but there is no such process.
I looked for the handle in the resource monitor (and process manager) and the file is being use by python when phy template-gui is running but after that (or before) there is non.
I was wondering if somebody encounter this issue before.
Thaks,

Pedro

Cyrille Rossant

unread,
Jul 1, 2019, 5:12:52 AM7/1/19
to Pedro Lagomarsino, phy-users
Perhaps the memmap file handles are not properly released when the GUI is closed. If you reboot your computer, does it work if you restart phy the first time you do it after the reboot?
Cyrille


--
You received this message because you are subscribed to the Google Groups "phy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phy-users+...@googlegroups.com.
To post to this group, send email to phy-...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/phy-users/df20d062-c115-4033-8210-747a020b3d95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Michael Lagler

unread,
Jul 17, 2019, 3:12:06 PM7/17/19
to phy-users
Hi all,

I am encountering the same problem. Rebooting didnt help. It is specifically the dat. file that the permission is denied. If I remove the dat. file from the folder I receive a couple of other error messages but phy2.0 runs otherwise.

Also I have phy1.0 under a different environment successfully running. Could there be a conflict?

Thanks,
Michael
Reply all
Reply to author
Forward
0 new messages