Skip to content

Update the doc to recommend to use python/3.10 #275

@qiyubio

Description

@qiyubio

Hi, there, this installation doc needs to be updated, it still recommend python/3.7 and python/3.8: https://docs.scarches.org/en/latest/installation.html.
And even installation with python/3.9 will fail on the sca.models.SCVI.load_query_data step of https://github.com/theislab/scarches/blob/master/notebooks/scvi_surgery_pipeline.ipynb:

>>> model = sca.models.SCVI.load_query_data(
...     target_adata,
...     ref_path,
...     freeze_dropout = True,
... )
INFO     File ref_model/model.pt already downloaded                                                                                                                 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/conda/envs/scarches/lib/python3.9/site-packages/scvi/model/base/_archesmixin.py", line 86, in load_query_data
    attr_dict, var_names, load_state_dict = _get_loaded_data(reference_model, device=device)
  File "/conda/envs/scarches/lib/python3.9/site-packages/scvi/model/base/_archesmixin.py", line 323, in _get_loaded_data
    attr_dict, var_names, load_state_dict, _ = _load_saved_files(
  File "/conda/envs/scarches/lib/python3.9/site-packages/scvi/model/base/_utils.py", line 66, in _load_saved_files
    model = torch.load(model_path, map_location=map_location)
  File "/conda/envs/scarches/lib/python3.9/site-packages/torch/serialization.py", line 1529, in load
    raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint. 
	(1) In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
	(2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message.
	WeightsUnpickler error: Unsupported global: GLOBAL numpy.core.multiarray._reconstruct was not an allowed global by default. Please use `torch.serialization.add_safe_globals([numpy.core.multiarray._reconstruct])` or the `torch.serialization.safe_globals([numpy.core.multiarray._reconstruct])` context manager to allowlist this global if you trust this class/function.

We track down the error is due to that the highest scvitools could be installed on python/3.9 is 1.1.6.post2, so
python/3.10 is required for scvi-tools/1.3.3 or any version >1.1.6.post2 to avoid the upper error.

This is our installation version as a reference:

mamba create -n scarches python=3.10
mamba activate scarches
mamba install uv
uv pip install scArches==0.6.1
# there was some compatible issue with numpy/2
uv pip install numpy==1.26.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions