STOmics / SAW

GNU General Public License v3.0
119 stars 32 forks source link

Incompatible matplotlib and numpy version in the .sif files #98

Open MathurinD opened 3 months ago

MathurinD commented 3 months ago

Hi,

I could run the SAW pipeline until 02.count, then I get the following error for the 04.tissuecut step:

singularity exec SAW_7.0.sif tissueCut -i pipeline_testing/stereopipeline/02.count/B02009A4.raw.gef --dnbfile pipeline_testing/stereopipeline/01.merge/B02009A4.merge.barcodeReadsCount.txt --sn B02009A4 -O Transcriptomics -d -t 8 -o pipeline_testing/stereopipeline/04.tissuecut Traceback (most recent call last): File "tissueCut/Tissuecut.py", line 7, in File "/usr/local/python3/lib/python3.8/site-packages/matplotlib/init.py", line 229, in _check_versions() File "/usr/local/python3/lib/python3.8/site-packages/matplotlib/init.py", line 225, in _check_versions raise ImportError(f"Matplotlib requires {modname}>={minver}; " ImportError: Matplotlib requires numpy>=1.20; you have 1.19.1

When I try to fix it with

singularity exec SAW_7.0.sif pip3 install numpy==1.24.4

The next error is:

AttributeError: module 'numpy' has no attribute 'bool'. np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

So I reverted numpy to 1.19.1

singularity exec SAW_7.0.sif pip3 install numpy==1.19.1

And downgraded matplotlib instead to a version compatible with numpy 1.19 (https://matplotlib.org/devdocs/devel/min_dep_policy.html)

singularity exec SAW_7.0.sif pip3 install matplotlib==3.6

And it worked. So it seems the SAW pipeline is not compatible with numpy>=1.20 as it uses deprecated attributes, but packages a matplotlib version that requires it.

Note: SAW was built with singularity build SAW_7.0.sif docker://stomics/saw:07.0.1

MathurinD commented 3 months ago

matplotlib is also not the only conflict with numpy, but the others do not break the pipeline as far as I could see.

singularity exec SAW_7.0.sif pip3 install numpy==1.19.1 INFO: gocryptfs not found, will not be able to use gocryptfs WARNING: The directory '/scratch/local/spwprj/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag. Defaulting to user installation because normal site-packages is not writeable Collecting numpy==1.19.1 Downloading numpy-1.19.1-cp38-cp38-manylinux2010_x86_64.whl (14.5 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.5/14.5 MB 73.8 MB/s eta 0:00:00 Installing collected packages: numpy Attempting uninstall: numpy Found existing installation: numpy 1.19.2 Uninstalling numpy-1.19.2: Successfully uninstalled numpy-1.19.2 xarray 0.20.1 requires pandas>=1.1, but you have pandas 1.0.5 which is incompatible. stio 0.1.8 requires numpy==1.24.2, but you have numpy 1.19.1 which is incompatible. stio 0.1.8 requires pandas==1.5.3, but you have pandas 1.0.5 which is incompatible. stio 0.1.8 requires pytz==2022.7.1, but you have pytz 2020.1 which is incompatible. stio 0.1.8 requires six==1.16.0, but you have six 1.15.0 which is incompatible. stio 0.1.8 requires tqdm==4.64.1, but you have tqdm 4.65.0 which is incompatible. stereopy 0.12.1 requires h5py<=3.7.0,>=3.2.1, but you have h5py 3.8.0 which is incompatible. stereopy 0.12.1 requires imageio==2.9.0, but you have imageio 2.31.6 which is incompatible. stereopy 0.12.1 requires joblib~=1.0.1, but you have joblib 1.3.2 which is incompatible. stereopy 0.12.1 requires matplotlib<=3.5.2,>=3.4.2, but you have matplotlib 3.6.0 which is incompatible. stereopy 0.12.1 requires numpy==1.21.6, but you have numpy 1.19.1 which is incompatible. stereopy 0.12.1 requires onnxruntime==1.14.1, but you have onnxruntime 1.16.1 which is incompatible. stereopy 0.12.1 requires opencv-python<=4.5.5.64,>=4.5.4.58, but you have opencv-python 4.8.0.76 which is incompatible. stereopy 0.12.1 requires pandas==1.5.3, but you have pandas 1.0.5 which is incompatible. stereopy 0.12.1 requires scikit-image==0.19.0, but you have scikit-image 0.21.0 which is incompatible. stereopy 0.12.1 requires scikit-learn==1.0.1, but you have scikit-learn 1.3.0 which is incompatible. stereopy 0.12.1 requires scipy==1.7.3, but you have scipy 1.5.2 which is incompatible. stereopy 0.12.1 requires tifffile==2021.11.2, but you have tifffile 2023.2.3 which is incompatible. squidpy 1.2.2 requires pandas>=1.2.0, but you have pandas 1.0.5 which is incompatible. scikit-image 0.21.0 requires numpy>=1.21.1, but you have numpy 1.19.1 which is incompatible. scikit-image 0.21.0 requires scipy>=1.8, but you have scipy 1.5.2 which is incompatible. pyscenic 0.12.1 requires pandas>=1.3.5, but you have pandas 1.0.5 which is incompatible. pysal 2.5.0 requires python-dateutil<=2.8.0, but you have python-dateutil 2.8.1 which is incompatible. pot 0.8.1.0 requires numpy>=1.20, but you have numpy 1.19.1 which is incompatible. onnxruntime 1.16.1 requires numpy>=1.21.6, but you have numpy 1.19.1 which is incompatible. omnipath 1.0.5 requires pandas>=1.2.0, but you have pandas 1.0.5 which is incompatible. gefpy 0.7.14 requires numpy>=1.20.0, but you have numpy 1.19.1 which is incompatible. cell-bin 1.2.0.6.1 requires matplotlib>=3.7.1, but you have matplotlib 3.6.0 which is incompatible. cell-bin 1.2.0.6.1 requires numpy>=1.22.3, but you have numpy 1.19.1 which is incompatible. cell-bin 1.2.0.6.1 requires pandas>=1.5.3, but you have pandas 1.0.5 which is incompatible. bio 1.3.3 requires biopython>=1.79, but you have biopython 1.77 which is incompatible. Successfully installed numpy-1.19.1

TheSallyGardens commented 2 months ago

@MathurinD Hi! The information you provided contains numpy=1.19.1, but I checked the numpy=1.23.5 in SAW v7.0.1. Can you double check the numpy version information in SAW v7.0.1?