Phy gui is blank apart from cluster view and similarity view--if using python 3.12
When I open the gui using the command phy template-gui params.py, the gui opens but apart from what is listed in the title, nothing shows up. I am on a windows 10 machine with an intel x-series processor.
If you run:
phy template-gui params.py --debug
What appears?
This is what appears:
11:33:28.470 [D] init:68 Start capturing exceptions.
11:33:28.594 [D] model:619 Loading spike clusters.
11:33:28.711 [D] model:569 No channel shank file found.
11:33:28.712 [D] model:692 Loading templates.
11:33:28.715 [D] model:720 Templates are sparse.
11:33:28.720 [W] model:667 Skipping spike waveforms that do not exist, they will be extracted on the fly from the raw data as needed.
11:33:28.720 [D] model:730 Loading the whitening matrix.
11:33:28.720 [D] model:434 Whitening matrix file not found.
11:33:28.721 [D] model:737 Loading the inverse of the whitening matrix.
11:33:28.721 [D] model:440 Whitening matrix inverse file not found, computing it.
11:33:28.721 [D] model:744 Inversing the whitening matrix (3, 3).
11:33:28.725 [D] model:766 Loading features.
11:33:28.727 [D] model:781 Features are sparse.
11:33:28.727 [D] model:803 Loading template features.
11:33:28.728 [D] model:504 Load cluster_channel_group.tsv.
11:33:28.729 [D] model:504 Load cluster_group.tsv.
11:33:28.730 [D] model:504 Load cluster_si_unit_ids.tsv.
11:33:29.365 [D] context:80 Create cache directory C:\Users\User\Desktop\Abhinav\files3\.phy.
11:33:29.412 [D] context:100 Initialize joblib cache dir at C:\Users\User\Desktop\Abhinav\files3\.phy.
11:33:29.413 [D] context:101 Reducing the size of the cache if needed.
11:33:29.415 [D] base:102 Add filter high_pass.
11:33:29.416 [D] config:31 Load config file C:\Users\User\.phy\phy_config.py.
11:33:29.417 [D] plugin:145 Loading 0 plugins.
11:33:29.423 [D] context:209 The file C:\Users\User\Desktop\Abhinav\files3\.phy\new_cluster_id.pkl doesn't exist.
11:33:29.423 [D] context:209 The file C:\Users\User\Desktop\Abhinav\files3\.phy\spikes_per_cluster.pkl doesn't exist.
11:33:29.443 [D] clustering:237 Recompute spikes_per_cluster manually: this might take a while.
11:33:29.651 [D] context:185 Save data to C:\Users\User\Desktop\Abhinav\files3\.phy\spikes_per_cluster.pkl.
11:33:29.666 [D] gui:463 Creating GUI.
11:33:29.691 [D] state:46 Load C:\Users\User.phy\TemplateGUI\state.json for GUIState.
11:33:30.195 [D] gui:718 Add view ClusterView to GUI.
11:33:30.209 [D] gui:718 Add view SimilarityView to GUI.
11:33:30.245 [D] gui:718 Add view WaveformView to GUI.
11:33:30.513 [D] base:337 Set state for WaveformView.
11:33:30.543 [D] gui:718 Add view WaveformView to GUI.
11:33:30.546 [D] base:337 Set state for WaveformView (1).
11:33:30.555 [D] gui:718 Add view TraceImageView to GUI.
11:33:30.557 [D] base:337 Set state for TraceImageView.
11:33:30.557 [D] base:494 Set color scheme to random.
11:33:30.562 [D] base:1626 Adding default color schemes to TraceImageView.
11:33:31.046 [D] gui:519 Load the geometry state.
dict_keys([<class 'numpy.ndarray'>, <class 'bytes'>, <class 'OpenGL.converters.c_long_Array_1'>])
11:33:31.217 [D] base:702 Exception in paintGL: ("No array-type handler for type _ctypes.CArgObject (value: <cparam 'P' (0x000001F4366CD098)>) registered", 'Failure in cConverter <OpenGL.converters.OutputOrInput object at 0x000001F42B70E990>', (3, 0, 32, <cparam 'P' (0x000001F4366CD098)>, <cparam 'P' (0x000001F4366CD118)>, <cparam 'P' (0x000001F4366CCC18)>, <ctypes.c_char_Array_32 object at 0x000001F4366CD150>), 3, <OpenGL.platform.baseplatform.glGetActiveAttrib object at 0x000001F429B807D0>)
So your install is busted :(
Now we need to figure out why. How did you install?
I installed using a yml file containing the following text: name: phy2 channels:
- conda-forge
- defaults dependencies:
- python
- pip
- git
- numpy
- matplotlib
- scipy
- h5py
- pyqt
- pyopengl
- pyqtwebengine
- pytest
- qtconsole
- requests
- responses
- traitlets
- dask
- cython
- pillow
- scikit-learn
- joblib
- pip:
- git+https://github.com/cortex-lab/phy.git
could you do
conda list
inside of the environment you created ?
packages in environment at C:\Users\User\anaconda3\envs\phy2:
Name Version Build Channel
asttokens 2.4.1 pyhd8ed1ab_0 conda-forge aws-c-auth 0.7.22 ha390a07_2 conda-forge aws-c-cal 0.6.14 h750c3ff_1 conda-forge aws-c-common 0.9.19 h2466b09_0 conda-forge aws-c-compression 0.2.18 h750c3ff_6 conda-forge aws-c-event-stream 0.4.2 he05106e_12 conda-forge aws-c-http 0.8.1 h55c4ea9_17 conda-forge aws-c-io 0.14.8 ha255af7_5 conda-forge aws-c-mqtt 0.10.4 heb8cf2b_4 conda-forge aws-c-s3 0.5.9 haf5e0f7_3 conda-forge aws-c-sdkutils 0.1.16 h750c3ff_2 conda-forge aws-checksums 0.1.18 h750c3ff_6 conda-forge aws-crt-cpp 0.26.9 hb2f7e64_0 conda-forge aws-sdk-cpp 1.11.329 h752cf48_3 conda-forge bokeh 3.4.1 pyhd8ed1ab_0 conda-forge brotli 1.1.0 hcfcfb64_1 conda-forge brotli-bin 1.1.0 hcfcfb64_1 conda-forge brotli-python 1.1.0 py312h53d5487_1 conda-forge bzip2 1.0.8 hcfcfb64_5 conda-forge c-ares 1.28.1 hcfcfb64_0 conda-forge ca-certificates 2024.6.2 h56e8100_0 conda-forge cached-property 1.5.2 hd8ed1ab_1 conda-forge cached_property 1.5.2 pyha770c72_1 conda-forge certifi 2024.2.2 pyhd8ed1ab_0 conda-forge charset-normalizer 3.3.2 pyhd8ed1ab_0 conda-forge click 8.1.7 win_pyh7428d3b_0 conda-forge cloudpickle 3.0.0 pyhd8ed1ab_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge colorcet 3.1.0 pypi_0 pypi comm 0.2.2 pyhd8ed1ab_0 conda-forge contourpy 1.2.1 py312h0d7def4_0 conda-forge cycler 0.12.1 pyhd8ed1ab_0 conda-forge cython 3.0.10 py312h53d5487_0 conda-forge cytoolz 0.12.3 py312he70551f_0 conda-forge dask 2024.5.2 pyhd8ed1ab_0 conda-forge dask-core 2024.5.2 pyhd8ed1ab_0 conda-forge dask-expr 1.1.2 pyhd8ed1ab_0 conda-forge debugpy 1.8.1 py312h53d5487_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge distributed 2024.5.2 pyhd8ed1ab_0 conda-forge exceptiongroup 1.2.0 pyhd8ed1ab_2 conda-forge executing 2.0.1 pyhd8ed1ab_0 conda-forge fonttools 4.53.0 py312h4389bb4_0 conda-forge freetype 2.12.1 hdaf720e_2 conda-forge freetype-py 2.4.0 pypi_0 pypi fsspec 2024.5.0 pyhff2d567_0 conda-forge gettext 0.22.5 h5728263_2 conda-forge gettext-tools 0.22.5 h7d00a51_2 conda-forge ghp-import 2.1.0 pypi_0 pypi git 2.45.1 h57928b3_0 conda-forge glib 2.80.2 h0df6a38_0 conda-forge glib-tools 2.80.2 h2f9d560_0 conda-forge gst-plugins-base 1.22.9 h001b923_1 conda-forge gstreamer 1.22.9 hb4038d2_1 conda-forge h5py 3.11.0 nompi_py312ha036244_101 conda-forge hdf5 1.14.3 nompi_h2b43c12_103 conda-forge hsluv 5.0.4 pypi_0 pypi icu 73.2 h63175ca_0 conda-forge idna 3.7 pyhd8ed1ab_0 conda-forge importlib-metadata 7.1.0 pyha770c72_0 conda-forge importlib_metadata 7.1.0 hd8ed1ab_0 conda-forge iniconfig 2.0.0 pyhd8ed1ab_0 conda-forge intel-openmp 2024.1.0 h57928b3_966 conda-forge ipykernel 6.29.3 pyha63f2e9_0 conda-forge ipython 8.25.0 pyh7428d3b_0 conda-forge jedi 0.19.1 pyhd8ed1ab_0 conda-forge jinja2 3.1.4 pyhd8ed1ab_0 conda-forge joblib 1.4.2 pyhd8ed1ab_0 conda-forge jupyter_client 8.6.2 pyhd8ed1ab_0 conda-forge jupyter_core 5.7.2 py312h2e8e312_0 conda-forge kiwisolver 1.4.5 py312h0d7def4_1 conda-forge krb5 1.21.2 heb0366b_0 conda-forge lcms2 2.16 h67d730c_0 conda-forge lerc 4.0.0 h63175ca_0 conda-forge libabseil 20240116.2 cxx17_h63175ca_0 conda-forge libaec 1.1.3 h63175ca_0 conda-forge libarrow 16.1.0 h35ad6a0_6_cpu conda-forge libarrow-acero 16.1.0 he0c23c2_6_cpu conda-forge libarrow-dataset 16.1.0 he0c23c2_6_cpu conda-forge libarrow-substrait 16.1.0 h1f0e801_6_cpu conda-forge libasprintf 0.22.5 h5728263_2 conda-forge libasprintf-devel 0.22.5 h5728263_2 conda-forge libblas 3.9.0 22_win64_mkl conda-forge libbrotlicommon 1.1.0 hcfcfb64_1 conda-forge libbrotlidec 1.1.0 hcfcfb64_1 conda-forge libbrotlienc 1.1.0 hcfcfb64_1 conda-forge libcblas 3.9.0 22_win64_mkl conda-forge libclang13 18.1.6 default_hf64faad_0 conda-forge libcrc32c 1.1.2 h0e60522_0 conda-forge libcurl 8.8.0 hd5e4a3a_0 conda-forge libdeflate 1.20 hcfcfb64_0 conda-forge libevent 2.1.12 h3671451_1 conda-forge libexpat 2.6.2 h63175ca_0 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge libgettextpo 0.22.5 h5728263_2 conda-forge libgettextpo-devel 0.22.5 h5728263_2 conda-forge libglib 2.80.2 h0df6a38_0 conda-forge libgoogle-cloud 2.24.0 h5e7cea3_0 conda-forge libgoogle-cloud-storage 2.24.0 hce61461_0 conda-forge libgrpc 1.62.2 h5273850_0 conda-forge libhwloc 2.10.0 default_h8125262_1001 conda-forge libiconv 1.17 hcfcfb64_2 conda-forge libintl 0.22.5 h5728263_2 conda-forge libintl-devel 0.22.5 h5728263_2 conda-forge libjpeg-turbo 3.0.0 hcfcfb64_1 conda-forge liblapack 3.9.0 22_win64_mkl conda-forge libogg 1.3.4 h8ffe710_1 conda-forge libparquet 16.1.0 h178134c_6_cpu conda-forge libpng 1.6.43 h19919ed_0 conda-forge libprotobuf 4.25.3 h503648d_0 conda-forge libre2-11 2023.09.01 hf8d8778_2 conda-forge libsodium 1.0.18 h8d14728_1 conda-forge libsqlite 3.45.3 hcfcfb64_0 conda-forge libssh2 1.11.0 h7dfc565_0 conda-forge libthrift 0.19.0 ha2b3283_1 conda-forge libtiff 4.6.0 hddb2be6_3 conda-forge libutf8proc 2.8.0 h82a8f57_0 conda-forge libvorbis 1.3.7 h0e60522_0 conda-forge libwebp 1.4.0 h2466b09_0 conda-forge libwebp-base 1.4.0 hcfcfb64_0 conda-forge libxcb 1.15 hcd874cb_0 conda-forge libxml2 2.12.7 h73268cd_0 conda-forge libzlib 1.3.1 h2466b09_1 conda-forge locket 1.0.0 pyhd8ed1ab_0 conda-forge lz4 4.3.3 py312h594ca44_0 conda-forge lz4-c 1.9.4 hcfcfb64_0 conda-forge m2w64-gcc-libgfortran 5.3.0 6 conda-forge m2w64-gcc-libs 5.3.0 7 conda-forge m2w64-gcc-libs-core 5.3.0 7 conda-forge m2w64-gmp 6.1.0 2 conda-forge m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge markdown 3.6 pypi_0 pypi markupsafe 2.1.5 py312he70551f_0 conda-forge matplotlib 3.8.4 py312h2e8e312_2 conda-forge matplotlib-base 3.8.4 py312hfee7060_2 conda-forge matplotlib-inline 0.1.7 pyhd8ed1ab_0 conda-forge mergedeep 1.3.4 pypi_0 pypi mkdocs 1.6.0 pypi_0 pypi mkdocs-get-deps 0.2.0 pypi_0 pypi mkl 2024.1.0 h66d3029_692 conda-forge msgpack-python 1.0.8 py312hd5eb7cc_0 conda-forge msys2-conda-epoch 20160418 1 conda-forge mtscomp 1.0.2 pypi_0 pypi munkres 1.1.4 pyh9f0ad1d_0 conda-forge nest-asyncio 1.6.0 pyhd8ed1ab_0 conda-forge numpy 1.26.4 py312h8753938_0 conda-forge openjpeg 2.5.2 h3d672ee_0 conda-forge openssl 3.3.0 h2466b09_3 conda-forge orc 2.0.1 h7e885a9_1 conda-forge packaging 24.0 pyhd8ed1ab_0 conda-forge pandas 2.2.2 py312h72972c8_1 conda-forge parso 0.8.4 pyhd8ed1ab_0 conda-forge partd 1.4.2 pyhd8ed1ab_0 conda-forge pathspec 0.12.1 pypi_0 pypi pcre2 10.43 h17e33f8_0 conda-forge phy 2.0b5 pypi_0 pypi phylib 2.5.0 pypi_0 pypi pickleshare 0.7.5 py_1003 conda-forge pillow 10.3.0 py312h6f6a607_0 conda-forge pip 24.0 pyhd8ed1ab_0 conda-forge platformdirs 4.2.2 pyhd8ed1ab_0 conda-forge pluggy 1.5.0 pyhd8ed1ab_0 conda-forge ply 3.11 pyhd8ed1ab_2 conda-forge prompt-toolkit 3.0.42 pyha770c72_0 conda-forge psutil 5.9.8 py312he70551f_0 conda-forge pthread-stubs 0.4 hcd874cb_1001 conda-forge pthreads-win32 2.9.1 hfa6e2cd_3 conda-forge pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge pyarrow 16.1.0 py312hd42ba9a_1 conda-forge pyarrow-core 16.1.0 py312h78844f3_1_cpu conda-forge pyarrow-hotfix 0.6 pyhd8ed1ab_0 conda-forge pygments 2.18.0 pyhd8ed1ab_0 conda-forge pyopengl 3.1.6 pyhd8ed1ab_1 conda-forge pyparsing 3.1.2 pyhd8ed1ab_0 conda-forge pyqt 5.15.9 py312he09f080_5 conda-forge pyqt5-sip 12.12.2 py312h53d5487_5 conda-forge pyqtwebengine 5.15.9 py312hca0710b_5 conda-forge pysocks 1.7.1 pyh0701188_6 conda-forge pytest 8.2.1 pyhd8ed1ab_0 conda-forge python 3.12.3 h2628c8c_0_cpython conda-forge python-dateutil 2.9.0 pyhd8ed1ab_0 conda-forge python-tzdata 2024.1 pyhd8ed1ab_0 conda-forge python_abi 3.12 4_cp312 conda-forge pytz 2024.1 pyhd8ed1ab_0 conda-forge pywin32 306 py312h53d5487_2 conda-forge pyyaml 6.0.1 py312he70551f_1 conda-forge pyyaml-env-tag 0.1 pypi_0 pypi pyzmq 26.0.3 py312hd7027bb_0 conda-forge qt-main 5.15.8 h9e85ed6_20 conda-forge qt-webengine 5.15.8 h4bf5c4e_4 conda-forge qtconsole 5.5.2 pyhd8ed1ab_0 conda-forge qtconsole-base 5.5.2 pyha770c72_0 conda-forge qtpy 2.4.1 pyhd8ed1ab_0 conda-forge re2 2023.09.01 hd3b24a8_2 conda-forge requests 2.32.3 pyhd8ed1ab_0 conda-forge responses 0.25.0 pyhd8ed1ab_0 conda-forge scikit-learn 1.5.0 py312h816cc57_1 conda-forge scipy 1.13.1 py312h1f4e10d_0 conda-forge setuptools 70.0.0 pyhd8ed1ab_0 conda-forge sip 6.7.12 py312h53d5487_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.2.0 hfb803bf_1 conda-forge sortedcontainers 2.4.0 pyhd8ed1ab_0 conda-forge stack_data 0.6.2 pyhd8ed1ab_0 conda-forge tbb 2021.12.0 hc790b64_1 conda-forge tblib 3.0.0 pyhd8ed1ab_0 conda-forge threadpoolctl 3.5.0 pyhc1e730c_0 conda-forge tk 8.6.13 h5226925_1 conda-forge toml 0.10.2 pyhd8ed1ab_0 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge toolz 0.12.1 pyhd8ed1ab_0 conda-forge tornado 6.4 py312he70551f_0 conda-forge tqdm 4.66.4 pypi_0 pypi traitlets 5.14.3 pyhd8ed1ab_0 conda-forge types-pyyaml 6.0.12.20240311 pyhd8ed1ab_0 conda-forge typing_extensions 4.12.1 pyha770c72_0 conda-forge tzdata 2024a h0c530f3_0 conda-forge ucrt 10.0.22621.0 h57928b3_0 conda-forge urllib3 2.2.1 pyhd8ed1ab_0 conda-forge vc 14.3 ha32ba9b_20 conda-forge vc14_runtime 14.38.33135 h835141b_20 conda-forge vispy 0.14.2 pypi_0 pypi vs2015_runtime 14.38.33135 h22015db_20 conda-forge watchdog 4.0.1 pypi_0 pypi wcwidth 0.2.13 pyhd8ed1ab_0 conda-forge wheel 0.43.0 pyhd8ed1ab_1 conda-forge win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge xorg-libxau 1.0.11 hcd874cb_0 conda-forge xorg-libxdmcp 1.1.3 hcd874cb_0 conda-forge xyzservices 2024.4.0 pyhd8ed1ab_0 conda-forge xz 5.2.6 h8d14728_0 conda-forge yaml 0.2.5 h8ffe710_2 conda-forge zeromq 4.3.5 he1f189c_4 conda-forge zict 3.0.0 pyhd8ed1ab_0 conda-forge zipp 3.17.0 pyhd8ed1ab_0 conda-forge zstd 1.5.6 h0ea2cb4_0 conda-forge
Does openGL work on your Intel x-series? Seems like the error is happening there.
How do I check that openGL works correctly?
I would just google. For example Apple deprecated the use of openGL on macOS years ago which makes it very hard/basically impossible at this point to run phy on an M-series Mac. So I would google your exact processor and see if there are any issues with openGL on your processor/ in Windows 10.
I've got Phy working on a Windows ten, but on the standard i-series processors, so I just wasn't sure if the x-series were the problem.
From what I see, intel x-series processors themselves do not have graphics support. However, the computer I am using does appear to have a graphics card that supports at least openGL 4.5. Second, when I look in windows settings, hardware accelerated gpu scheduling is off.
name: phy2_test
channels:
- conda-forge
- defaults
dependencies:
- python=3.11
- pip
- git
- numpy
- matplotlib
- scipy
- h5py
- pyqt
- pyopengl
- pyqtwebengine
- pytest
- qtconsole
- requests
- responses
- traitlets
- dask
- cython
- pillow
- scikit-learn
- joblib
- pip:
- git+https://github.com/cortex-lab/phy.git
could you try using this as your yaml instead. We recently tried adding 3.12 support, but I think it might not be fully there yet.
That works. Thank you.
Thank you! It helped me discover that there is still an issue with 3.12. I changed the yaml file to automatically just do python 3.11 until I can track down the issue.
For anyone looking into this, at least on macOS M1 the issue seems to be with opengl
when setting up the startup of phy like this it works, now I am still unable to use manual clustering,
import os
from pathlib import Path
from PyQt5.QtGui import QSurfaceFormat
from phy.apps.template import template_gui
# Set environment variables BEFORE importing QtWebEngine
os.environ['QTWEBENGINE_CHROMIUM_FLAGS'] = (
'--enable-gpu --use-gl=desktop --enable-features=VaapiVideoDecoder'
)
os.environ['QTWEBENGINE_DISABLE_SANDBOX'] = '1'
# Configure OpenGL for both PyQt5 and QtWebEngine
def setup_opengl_for_webengine():
# This must be called before QApplication creation
# QApplication.setAttribute(Qt.AA_ShareOpenGLContexts, True)
format = QSurfaceFormat()
format.setVersion(2, 1) # Mac M1 maximum
format.setProfile(QSurfaceFormat.CoreProfile)
format.setDepthBufferSize(24)
format.setStencilBufferSize(8)
format.setSamples(4)
format.setSwapBehavior(QSurfaceFormat.DoubleBuffer)
QSurfaceFormat.setDefaultFormat(format)
# Apply configuration
setup_opengl_for_webengine()
# Now all OpenGL contexts created will use this format
# %%
HOME_PATH = Path().home()
BASE_PATH = HOME_PATH / 'Documents'
PARAMS_PATH = BASE_PATH / 'ks4_output_2025-06-10_19-27' / 'sorter_output' / 'params.py'
# %%
template_gui(PARAMS_PATH)
An OpenGL surfcace format was requested that is either not version 3.2 or higher or a not Core Profile.
Chromium on macOS will fall back to software rendering in this case.
Hardware acceleration and features such as WebGL will not be available.
Sandboxing disabled by user.