diff --git a/README.md b/README.md index af451f83..fb58a7b9 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Phy provides two GUIs: ## What's new - +* [5 June 2024] phy 2.0 beta 6, bug fixes, install work, fixing some deprecations * [7 Sep 2021] Release of phy 2.0 beta 5, with some install and bug fixes * [7 Feb 2020] Release of phy 2.0 beta 1, with many new views, new features, various improvements and bug fixes... @@ -44,7 +44,7 @@ Run the following commands in a terminal: 1. Create a new conda environment with the conda dependencies: ``` - conda create -n phy2 -y cython dask h5py joblib matplotlib numpy pillow pip pyopengl pyqt pyqtwebengine pytest python qtconsole requests responses scikit-learn scipy traitlets + conda create -n phy2 -y python=3.11 cython dask h5py joblib matplotlib numpy pillow pip pyopengl pyqt pyqtwebengine pytest python qtconsole requests responses scikit-learn scipy traitlets ``` 2. Activate the new conda environment with `conda activate phy2` @@ -60,6 +60,9 @@ cd path/to/my/spikesorting/output phy template-gui params.py ``` +6. If there are problems with this method we also have an `environment.yml` file which allows for +automatic install of the necessary packages. Give that a try. + ### Dealing with the error `ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidget` diff --git a/environment.yml b/environment.yml index 55eac984..9b4cb70e 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - python + - python=3.11 - pip - git - numpy diff --git a/phy/__init__.py b/phy/__init__.py index 0859c3ff..b1e036f4 100644 --- a/phy/__init__.py +++ b/phy/__init__.py @@ -28,7 +28,7 @@ __author__ = 'Cyrille Rossant' __email__ = 'cyrille.rossant at gmail.com' -__version__ = '2.0b5' +__version__ = '2.0b6' __version_git__ = __version__ + _git_version() diff --git a/phy/utils/plugin.py b/phy/utils/plugin.py index 6632fc4b..317e84ca 100644 --- a/phy/utils/plugin.py +++ b/phy/utils/plugin.py @@ -14,6 +14,7 @@ import importlib import logging import os +import sys from pathlib import Path from phylib.utils._misc import _fullname @@ -97,20 +98,20 @@ def discover_plugins(dirs): """ # Scan all subdirectories recursively. for path in _iter_plugin_files(dirs): - subdir = path.parent modname = path.stem if modname in ('phy_config', 'phycontrib_loader'): continue - file, path, descr = importlib.util.find_spec(modname, [subdir]) - if file: + spec = importlib.util.spec_from_file_location(modname, path) + if spec is not None: # Loading the module registers the plugin in # IPluginRegistry. try: - mod = importlib.load_module(modname, file, path, descr) # noqa + mod = importlib.util.module_from_spec(spec) # noqa + sys.modules[modname] = mod + spec.loader.exec_module(mod) except Exception as e: # pragma: no cover logger.exception(e) - finally: - file.close() + return IPluginRegistry.plugins diff --git a/requirements.txt b/requirements.txt index e436a3a6..f88dc8d8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ dask cython pillow colorcet -pyopengl +pyopengl==3.1.6 requests qtconsole tqdm