Closed jacobmhkim closed 1 week ago
Hi Jacob, unfortunately, that looks like an error with the package opencv-python-headless
and it sounds like they stopped supporting macOS 10.14.
However, I would still try something. Can you try from conda? Are you in a conda environment? If yes, you can try this command:
conda install -c fastai opencv-python-headless
If that works you will have to install Cell-ACDC manually by installing it without dependencies and installing them one by one. To install Cell-ACDC without dependencies run this command:
pip install --no-deps cellacdc
Then you install the dependencies. These are the required packages that you can install from pip with pip install package-name
:
numpy
natsort
h5py
pyqtgraph>=0.13.7
scikit-image>=0.18
tqdm
seaborn
scikit-learn
psutil
boto3
requests
setuptools-scm
Let me know if that works, thanks!
It seemed to have solved that problem, but I ran into another one. When I try to run acdc, it wants to install QtPy, but I run across an error when it tries to install it:
Cell-ACDC needs to install a GUI library (default library is
PyQt6`).
You can install it now or you can close (press "n") and install a compatible GUI library with one of the following commands:
* pip install PyQt6==6.6.0 PyQt6-Qt6==6.6.0
* pip install PyQt5 (or `conda install pyqt`)
* pip install PySide2
* pip install PySide6
Note: if PyQt6
installation fails, you could try installing any of the other libraries.
Do you want to install it now ([y]/n)? y
Requirement already satisfied: PyQt6==6.6.0 in /opt/anaconda3/envs/acdc/lib/python3.10/site-packages (6.6.0)
Requirement already satisfied: PyQt6-Qt6==6.6.0 in /opt/anaconda3/envs/acdc/lib/python3.10/site-packages (6.6.0)
Requirement already satisfied: PyQt6-sip<14,>=13.6 in /opt/anaconda3/envs/acdc/lib/python3.10/site-packages (from PyQt6==6.6.0) (13.6.0)
Traceback (most recent call last):
File "/opt/anaconda3/envs/acdc/bin/acdc", line 8, in
Oh ok, PyQt6 also doesn't seem to be supported on macos 10. I would try pyqt
from conda with conda install -c conda-forge pyqt
.
You have to uninstall PyQt6 first with pip uninstall PyQt6
.
Also, it might be easier to start from scratch.
First check the location of the acdc environment folder with the command conda env list
Then to remove the environment deactivate it and run the command conda env remove -n acdc
and check that the acdc folder is gone. If not delete it manually.
You can then restart from scratch and remember conda install -c conda-forge pyqt
before running acdc.
Let me know if it works thanks!
PS: I said "Hi Jordan", but I meant "Hi Jacob", my apologies 😄
No worries.
We tried re-creating the environment, and got past the issue. But now, we get another error right before acdc loads. We get a flash of the logo before getting this error message:
(acdc) DN0a230841:~ skotheimlab$ acdc Traceback (most recent call last): File "/opt/anaconda3/envs/acdc/bin/acdc", line 8, in <module> sys.exit(run()) File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/__main__.py", line 49, in run run_gui() File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/__main__.py", line 99, in run_gui app, splashScreen = _run._setup_app(splashscreen=True) File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/_run.py", line 361, in _setup_app from . import load File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/load.py", line 6, in <module> import cv2 File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cv2/__init__.py", line 181, in <module> bootstrap() File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cv2/__init__.py", line 153, in bootstrap native_module = importlib.import_module("cv2") File "/opt/anaconda3/envs/acdc/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: dlopen(/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cv2/cv2.abi3.so, 2): Library not loaded: @loader_path/.dylibs/libavcodec.60.31.102.dylib Referenced from: /opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cv2/cv2.abi3.so Reason: no suitable image found. Did find: /opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cv2/.dylibs/libavcodec.60.31.102.dylib: cannot load 'libavcodec.60.31.102.dylib' (load command 0x80000034 is unknown) /opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cv2/.dylibs/libavcodec.60.31.102.dylib: cannot load 'libavcodec.60.31.102.dylib' (load command 0x80000034 is unknown)
Ok interesting, stupid opencv.
I would try an older version then, maybe something less than 4.9 or even older.
To do so run conda install -c fastai "opencv-python-headless<4.9"
.
Here you can find the list of all the versions ever released https://anaconda.org/fastai/opencv-python-headless/files?page=1
Let me know if something works thanks!
You could also try to uninstall opencv-python-headless (with the command conda remove opencv-python-headless
and install the non headless version (also try older ones) with the command conda install -c conda-forge opencv
using the non headless version worked. Thanks!
Sorry, we got a new error when trying to run the segmentation module, when installing tensorflow. we get this message:
` File "/private/var/folders/n0/y06cp9mx3s337p18h34s6lxw0000gp/T/pip-install-exvx5q3o/grpcio_5685efc0990c4aedbf37be26d17800df/src/python/grpcio/support.py", line 76, in _expect_compile raise commands.CommandError( commands.CommandError: Diagnostics found a compilation environment issue:
Could not find <Python.h>. This could mean the following:
* You're on Ubuntu and haven't run `apt-get install python3-dev`.
* You're on RHEL/Fedora and haven't run `yum install python3-devel` or
`dnf install python3-devel` (make sure you also have redhat-rpm-config
installed)
* You're on Mac OS X and the usual Python framework was somehow corrupted
(check your environment variables or try re-installing?)
* You're on Windows and your Python installation was somehow corrupted
(check your environment variables or try re-installing?)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for grpcio Running setup.py clean for grpcio Failed to build grpcio ERROR: Could not build wheels for grpcio, which is required to install pyproject.toml-based projects
File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/myutils.py", line 2512 - 14:13:55:
Traceback (most recent call last):
File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/myutils.py", line 2480, in check_install_package
import_module(import_pkg_name)
File "/opt/anaconda3/envs/acdc/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/myutils.py", line 2504, in check_install_package _install_tensorflow() File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/myutils.py", line 2743, in _install_tensorflow subprocess.check_call(args, shell=shell) File "/opt/anaconda3/envs/acdc/lib/python3.10/subprocess.py", line 369, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/opt/anaconda3/envs/acdc/bin/Cell-ACDC', '-m', 'pip', 'install', '-U', 'tensorflow']' returned non-zero exit status 1.
`
Hi Jacob,
I would try to install tensorflow from conda with conda install -c conda-forge tensorflow
.
If it works you will need to install yeaz without dependencies because otherwise it would try to install tensorflow too (because yeaz is only with pip and pip cannot see what was installed with conda).
To do that run pip install --no-deps yeaz
. It might be that one or two packages are still missing from yeaz dependencies but I'm not sure. If yes, install the missing package too.
Let me know if it works thanks
We get another error when we do that. it looks like we don't have tensorflow.keras? I looked it up and it looks like we need tensorflow ver 1.14?
`Downloading YeaZ (if needed)...
Downloading YeaZ model(s) to "/Users/skotheimlab/acdc-appdata/acdc-YeaZ"
Importing YeaZ...
2024-07-12 10:21:24.148217: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/myutils.py", line 2894, in import_segment_module
acdcSegment = import_module(f'cellacdc.models.{model_name}.acdcSegment')
File "/opt/anaconda3/envs/acdc/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/_main.py", line 1597, in launchSegm self.segmWin.main() File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/segm.py", line 518, in main acdcSegment = myutils.import_segment_module(model_name) File "/opt/anaconda3/envs/acdc/lib/python3.10/site-packages/cellacdc/myutils.py", line 2899, in import_segment_module model_path = cp[model_name]['path'] File "/opt/anaconda3/envs/acdc/lib/python3.10/configparser.py", line 965, in getitem raise KeyError(key) KeyError: 'YeaZ'`
Keras should have been installed by tensorflow.
Can you check if you can import tensorflow? In the terminal, with the acdc
env activated, type the command python
to open python in the terminal then run import tensorflow
and then tensorflow.__version__
.
Technically YeaZ wants tensorflow <2.0 but we have been using it with tensorflow 2.x for years now and it works I would not worry about that.
One possible explanation is that keras does not have the same version as tensorflow as you can read here https://stackoverflow.com/questions/73796400/error-no-module-named-tensorflow-keras
However, it is much faster to remove the env and try from scratch.
Now that I think about it, it sounds like you want to use yeaz v1 and not v2 right? Because with yeaz v2 they abandoned tensorflow and they use pytorch instead. Do you have a reason for using v1 (like having your custom model)? Because v2 is the same or better than v1 and it might be easier to install pytorch instead of tensorflow.
Let me know thanks!
I'm using v1 because it seems to work better than v2. We can try v2 though.
we have tensorflow ver 2.16.1
ill try installing keras 2.1
If YeaZ v1 works better then stick to it absolutely.
Also try older versions of tensorflow, the 2.16
is from 10 days ago and I don't exclude they did not test it on older macos versions. Tensorflow <2.8 should also work. Let me know how it goes, thanks
2.1 didnt work, but it said tensorflow needs keras 3.0.0, so I tried that, and it seems to work. Thanks!
Great! Note that 2.1
is different from 2.16
because the 16
is actually 15 versions newer than 1.
Anyway I'm happy it works! Kind of cumbersome but developers are abandoning support to older versions of macos unfortunately.
Description:
Tried to install cell acdc on macos 10.14.6. During pip install stage, received this error:
`Downloading six-1.16.0-py2.py3-none-any.whl (11 kB) Building wheels for collected packages: opencv-python-headless Building wheel for opencv-python-headless (pyproject.toml) ... error error: subprocess-exited-with-error
× Building wheel for opencv-python-headless (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [84 lines of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for opencv-python-headless Failed to build opencv-python-headless ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (opencv-python-headless)`
Seems to require xcode, which requires a macos 14 to install.
Way to reproduce:
No response
(Optional) Link to data to reproduce error:
No response
Terminal output:
No response
Log file:
No response
Version information:
No response