文章目录
前言
phy是神经科学领域一个开源的可视化工具,为大规模神经记录信号提供图形用户界面和手工分选工具。本篇文章是根据phy官方文档的安装过程,存档方便下次重装环境,供大家参考。
Installation instructions
Run the following commands in a terminal:(直接在anaconda prompt中运行)
- Create a new conda environment with the conda dependencies: 指定python版本为3.11(小于3.12)
conda create -n phy2 -y cython dask h5py joblib matplotlib numpy pillow pip pyopengl pyqt pyqtwebengine pytest python=3.11.9 qtconsole requests responses scikit-learn scipy traitlets
debug ModuleNotFoundError: No module named ‘imp’
报错原因:imp模块从3.4后改为importlib,3.12后完全弃用
解决方案:
a. (推荐)环境中装小于3.12版本的python
b. 前往报错文件(plugin.py)中将imp改为importlib,注意开头的import部分和后面使用到的部分imp.xx都要修改。作者修改完后,gui能正常打开,但是有些窗口没有显示。
- Activate the new conda environment with
conda activate phy2
- Install the development version of phy:
pip install git+https://github.com/cortex-lab/phy.git
debug pip install git+https://github.com/cortex-lab/phy.git
a. 报错:找不到git
解决方案:前往git网站下载git,重启anaconda命令行,重新输入第2,3步命令。
b. github网络原因报错:
例如:
fatal: unable to access 'https://github.com/cortex-lab/phy.git/': Failed to connect to github.com port 443 after 21071 ms: Couldn't connect to server
error: subprocess-exited-with-error
或者
fatal: unable to access 'https://github.com/cortex-lab/phy.git/': OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0
error: subprocess-exited-with-error
解决方案:前往git的命令行git bash,运行以下代码取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
或者先设置代理再取消代理
git config --global http.proxy
git config --global https.proxy
git config --global --unset http.proxy
git config --global --unset https.proxy
c. pip网络原因报错:
例如:
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
解决方案:把pip install git + https分为两步
git clone https://github.com/cortex-lab/phy.git
cd phy
pip install -e .
-
[OPTIONAL] If you plan to use the Kwik GUI, type pip install klusta klustakwik2
-
Phy should now be installed. Open the GUI on a dataset as follows (the phy2 environment should still be activated):
//进入sort结果的路径
cd path/to/my/spikesorting/output
phy template-gui params.py
3万+

被折叠的 条评论
为什么被折叠?



