cortex-lab / phy

phy: interactive visualization and manual spike sorting of large-scale ephys data
BSD 3-Clause "New" or "Revised" License
314 stars 157 forks source link

GUI empty #1277

Closed EMerinoM14 closed 4 months ago

EMerinoM14 commented 4 months ago

Hello everybody! I have been trying to install kilosort (v4) and phy for a few days now. I have already managed to perform the first spike sorting through kilosort, however when I go to open the GUI of phy to see how it has been done, I find it empty, I can only see the clusters performed but nothing else.

Currently I get this error when executing the command "phy template-gui params.py" :

(phy2) C:\Users\Usuario\Desktop\Matlab\2024-04-03_12-56-50\kilosort4>phy template-gui params.py QMimeDatabase: Error loading internal MIME data An error has been encountered at line 1 of : Premature end of document..:

It is important to say that in order to get to open the phy2 GUII had to do several things. At the beginning I got the following errors:

(phy2) C:\Users\Usuario\Desktop\Matlab\2024-04-03_12-56-50\kilosort4>phy template-gui params.py Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\Usuario.conda\envs\phy2\Scripts\phy.exe__main.py", line 4, in File "C:\Users\Usuario.conda\envs\phy2\Lib\site-packages\phy\init.py", line 21, in from .utils.config import load_master_config File "C:\Users\Usuario.conda\envs\phy2\Lib\site-packages\phy\utils\init__.py", line 8, in from .plugin import IPlugin, attach_plugins File "C:\Users\Usuario.conda\envs\phy2\Lib\site-packages\phy\utils\plugin.py", line 14, in import imp ModuleNotFoundError: No module named 'imp'

To solve it I had to replace in the source code of phy the use of the module "imp" by "importlib". Specifically I had to modify the plugin.py file. I don't know if by modifying this file I have caused that nothing can be seen in the Phy2 GUI.

I would really appreciate your help! thumbnail_image

EMerinoM14 commented 4 months ago

The problem is solved in a very easy way, it is not necessary to change anything in the plugin.py file.

By default when you install phy2 it installs the latest version of python (in my case 3.12). The only thing I did was to go back to an earlier version of python (in the phy environment), specifically 3.9.13.

zm711 commented 4 months ago

Hopefully we got that fixed with a recent PR, but happy you solved it yourself!! :)