Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation issue on Google colab with GPU #167

Open
wgao688 opened this issue Feb 14, 2025 · 2 comments
Open

Installation issue on Google colab with GPU #167

wgao688 opened this issue Feb 14, 2025 · 2 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@wgao688
Copy link

wgao688 commented Feb 14, 2025

Hi,

I am running liana+ and scripts that formerly worked (as of 2 weeks ago) but are now running into issues with numpy in Google colab, using the T4 GPU option. I saw there were recent fixes addressing anndata and numpy version, but I'm not sure if this is related to my issue or not.

!pip install liana cell2cell decoupler omnipath seaborn==0.11

returns this warning

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
thinc 8.2.5 requires numpy<2.0.0,>=1.19.0; python_version >= "3.9", but you have numpy 2.1.3 which is incompatible.
langchain 0.3.17 requires numpy<2,>=1.22.4; python_version < "3.12", but you have numpy 2.1.3 which is incompatible.
pytensor 2.26.4 requires numpy<2,>=1.17.0, but you have numpy 2.1.3 which is incompatible.
tensorflow 2.18.0 requires numpy<2.1.0,>=1.26.0, but you have numpy 2.1.3 which is incompatible.
gensim 4.3.3 requires numpy<2.0,>=1.18.5, but you have numpy 2.1.3 which is incompatible.

Then, when actually importing the packages,

import pandas as pd
import scanpy as sc
import plotnine as p9
import pickle

it fails at the scanpy import step with this error:

/usr/local/lib/python3.11/dist-packages/numpy/_core/_dtype.py:106: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
  if dtype.type == np.bool:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-2-441c6a1f48e4>](https://localhost:8080/#) in <cell line: 0>()
      1 import pandas as pd
----> 2 import scanpy as sc
      3 import plotnine as p9
      4 import pickle
      5 

24 frames
[/usr/local/lib/python3.11/dist-packages/numpy/__init__.py](https://localhost:8080/#) in __getattr__(attr)
    322     warnings.filterwarnings("ignore", message="numpy.dtype size changed")
    323     warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
--> 324     warnings.filterwarnings("ignore", message="numpy.ndarray size changed")
    325 
    326     def __getattr__(attr):

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

Thanks for your help and for developing this amazing package!

@wgao688 wgao688 added bug Something isn't working help wanted Extra attention is needed labels Feb 14, 2025
@dbdimitrov
Copy link
Collaborator

Hi @wgao688,

I bumped the python and numpy versions in the last patch, so it might be causing some inconsistencies in some environments. I will try to investigate soon (I'm away most of next week so it might take me a week or so).

In the meantime, you could set the liana version to 1.5.0 (i.e. liana==1.5.0 in your pip install command), this should let you work with the liana version you used a couple of weeks ago.

Hope this helps!

@wgao688
Copy link
Author

wgao688 commented Feb 14, 2025

Hi @dbdimitrov ,

Thanks for your quick response! Running this, importantly with a specific version of numpy installed first, resolved the issues:

!pip install numpy==1.26.0 liana==1.5.0 cell2cell decoupler omnipath seaborn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants