cortex-lab / phy

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

Import Error: undefined symbol: _ZdaPvm, version Qt_5 #1214

Closed Jungsugiee closed 11 months ago

Jungsugiee commented 11 months ago

When calling the command phy template-gui params.py

I get the Error:

Traceback (most recent call last): File "/opt/miniconda3/envs/phy2/bin/phy", line 5, in from phy.apps import phycli File "/opt/miniconda3/envs/phy2/lib/python3.9/site-packages/phy/apps/init.py", line 22, in from phy.gui.qt import QtDialogLogger File "/opt/miniconda3/envs/phy2/lib/python3.9/site-packages/phy/gui/init.py", line 6, in from .qt import ( File "/opt/miniconda3/envs/phy2/lib/python3.9/site-packages/phy/gui/qt.py", line 31, in from PyQt5.QtCore import (Qt, QByteArray, QMetaObject, QObject, # noqa ImportError: /opt/miniconda3/envs/phy2/lib/python3.9/site-packages/PyQt5/QtCore.abi3.so: undefined symbol: _ZdaPvm, version Qt_5

I've Already tried to manually replace the Phy folder and tried re-downloading Phy.

zm711 commented 11 months ago

Hey @Jungsugiee, how did you try to reinstall?

The latest instructions should install with Python 3.11 and you have 3.9. Could you try removing the phy2 env and reinstalling?

conda remove -n phy2 --all

Followed by installing either with the included environment.yml on the home page (first download the yml cd to the folder containing it and then do:

conda create env -f environment.yml

or by doing:

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 activate phy2
pip install git+https://github.com/cortex-lab/phy.git
Jungsugiee commented 11 months ago

when I do that I get a sub-process error. So, I have installed the older version (which doesn't give me the error) and then upgraded the package to the new version. Then the error above mentioned is the new error that occurs.

This is the same error I experience with python 3.11

Traceback (most recent call last): File "/opt/miniconda3/envs/phy2/bin/phy", line 5, in from phy.apps import phycli File "/opt/miniconda3/envs/phy2/lib/python3.11/site-packages/phy/apps/init.py", line 22, in from phy.gui.qt import QtDialogLogger File "/opt/miniconda3/envs/phy2/lib/python3.11/site-packages/phy/gui/init.py", line 6, in from .qt import ( File "/opt/miniconda3/envs/phy2/lib/python3.11/site-packages/phy/gui/qt.py", line 31, in from PyQt5.QtCore import (Qt, QByteArray, QMetaObject, QObject, # noqa ImportError: /opt/miniconda3/envs/phy2/lib/python3.11/site-packages/PyQt5/QtCore.a(phy2) jungs(phy(phy2) j(ph(phy2) ((

zm711 commented 11 months ago

Which installation did you try? With or without the yaml?

And could you post what the subprocess error was? I'm trying to figure out if this is a git issue or an OS issue.

Jungsugiee commented 11 months ago

I tried it without the yaml. ~/Desktop$ pip install git+https://github.com/cortex-lab/phy.git Collecting git+https://github.com/cortex-lab/phy.git Cloning https://github.com/cortex-lab/phy.git to /tmp/pip-req-build-qzltm6jt Running command git clone --filter=blob:none --quiet https://github.com/cortex-lab/phy.git /tmp/pip-req-build-qzltm6jt /usr/lib/git-core/git-remote-https: symbol lookup error: /lib/x86_64-linux-gnu/libp11-kit.so.0: undefined symbol: ffi_type_pointer, version LIBFFI_BASE_7.0 error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/cortex-lab/phy.git /tmp/pip-req-build-qzltm6jt did not run successfully. │ exit code: 128 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/cortex-lab/phy.git /tmp/pip-req-build-qzltm6jt did not run successfully. │ exit code: 128 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

This is the error i see when I try to install phy through git

zm711 commented 11 months ago

That looks like you're on your base environment rather than in your conda environment. It should be

(phy2) $ pip install git+https://github.com/cortex-lab/phy.git

Yours doesn't indicate that you're in a virtual environment (but maybe that was just a copy paste error).

Did you try the pip install in your conda/miniconda environment? If not try the install within the virtual environment by first typing:

conda activate phy2

then pip install git....

I have two recommendations if the above doesn't work: 1), try the yaml install. It will automatically ensure things are installed into the correct environment and will call that environment phy2. This will ensure the configuration is all correct. 2) you can do a git clone workflow instead, so you would (do the same up until the pip install, but not type pip install) then do:

git clone https://github.com/cortex-lab/phy
cd path/to/phy
pip install .

This will attempt to build from the folder instead.

Jungsugiee commented 11 months ago

Thank you @zm711 using yml solved the problem entirely. I appreciate your time.