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 #279

Open
zhenlyu opened this issue Jan 3, 2025 · 1 comment
Open

Installation issue #279

zhenlyu opened this issue Jan 3, 2025 · 1 comment

Comments

@zhenlyu
Copy link

zhenlyu commented Jan 3, 2025

Hi,
I tried creating an environment using the commands below but encountered errors. Could you please help me resolve them?

conda create -n scgpt python=3.10 -y
conda activate scgpt
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install scgpt
pip install wandb
[rank: 0] Global seed set to 0
/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/anndata/utils.py:429: FutureWarning: Importing read_csv from `anndata` is deprecated. Import anndata.io.read_csv instead.
  warnings.warn(msg, FutureWarning)
/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/anndata/utils.py:429: FutureWarning: Importing read_loom from `anndata` is deprecated. Import anndata.io.read_loom instead.
  warnings.warn(msg, FutureWarning)
/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/anndata/utils.py:429: FutureWarning: Importing read_text from `anndata` is deprecated. Import anndata.io.read_text instead.
  warnings.warn(msg, FutureWarning)
Traceback (most recent call last):
  File "/cluster/pixstor/joshitr-lab/zl7w2/scGPT/examples/finetune_integration.py", line 16, in <module>
    import scvi
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/__init__.py", line 10, in <module>
    from . import autotune, data, model, external, utils
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/autotune/__init__.py", line 1, in <module>
    from ._manager import TuneAnalysis, TunerManager
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/autotune/_manager.py", line 21, in <module>
    from scvi.data._constants import _SETUP_ARGS_KEY, _SETUP_METHOD_NAME
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/data/__init__.py", line 25, in <module>
    from ._manager import AnnDataManager, AnnDataManagerValidationCheck
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/data/_manager.py", line 22, in <module>
    from ._utils import (
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/data/_utils.py", line 13, in <module>
    from anndata._core.sparse_dataset import SparseDataset
ImportError: cannot import name 'SparseDataset' from 'anndata._core.sparse_dataset' (/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/anndata/_core/sparse_dataset.py)
@zhenlyu
Copy link
Author

zhenlyu commented Jan 3, 2025

I tried pip install anndata==0.10.8 which resolved the previous issue. However, I encountered a new error. Should I downgrade NumPy to version 1.19.5 to address this?

### Starting at: Fri Jan  3 10:35:57 CST 2025 ###
[rank: 0] Global seed set to 0
/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scgpt/model/model.py:21: UserWarning: flash_attn is not installed
  warnings.warn("flash_attn is not installed")
/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scgpt/model/multiomic_model.py:19: UserWarning: flash_attn is not installed
  warnings.warn("flash_attn is not installed")
wandb: Using wandb-core as the SDK backend.  Please refer to https://wandb.me/wandb-core for more information.
/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/wandb/sdk/wandb_init.py:202: PydanticDeprecatedSince20: The `copy` method is deprecated; use `model_copy` instead. See the docstring of `BaseModel.copy` for details about how to handle `include` and `exclude`. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.10/migration/
  settings = self._wl.settings.copy()
wandb: Currently logged in as: tang27abu (zl7w2). Use `wandb login --relogin` to force relogin
wandb: Tracking run with wandb version 0.19.1
wandb: Run data is saved locally in /cluster/pixstor/joshitr-lab/zl7w2/scGPT/examples/wandb/run-20250103_103607-5d74gpgz
wandb: Run `wandb offline` to turn off syncing.
wandb: Syncing run drawn-waterfall-15
wandb: ⭐️ View project at https://wandb.ai/zl7w2/scGPT
wandb: 🚀 View run at https://wandb.ai/zl7w2/scGPT/runs/5d74gpgz
{'seed': 42, 'dataset_name': 'PBMC_10K', 'do_train': True, 'load_model': 'save/scGPT_bc', 'mask_ratio': 0.4, 'epochs': 30, 'n_bins': 51, 'GEPC': True, 'ecs_thres': 0.8, 'dab_weight': 1.0, 'lr': 0.0001, 'batch_size': 64, 'layer_size': 128, 'nlayers': 4, 'nhead': 4, 'dropout': 0.2, 'schedule_ratio': 0.9, 'save_eval_interval': 5, 'log_interval': 100, 'fast_transformer': True, 'pre_norm': False, 'amp': True}
save to save/dev_PBMC_10K-Jan03-10-36
�[34mINFO    �[0m File data/gene_info_pbmc.csv already downloaded                        
�[34mINFO    �[0m File data/pbmc_metadata.pickle already downloaded                      
�[34mINFO    �[0m File data/pbmc8k/filtered_gene_bc_matrices.tar.gz already downloaded   
�[34mINFO    �[0m Extracting tar file                                                    
�[34mINFO    �[0m Removing extracted data at data/pbmc8k/filtered_gene_bc_matrices       
�[34mINFO    �[0m File data/pbmc4k/filtered_gene_bc_matrices.tar.gz already downloaded   
�[34mINFO    �[0m Extracting tar file                                                    
�[34mINFO    �[0m Removing extracted data at data/pbmc4k/filtered_gene_bc_matrices       
/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/data/_built_in_data/_pbmc.py:76: FutureWarning: Use anndata.concat instead of AnnData.concatenate, AnnData.concatenate is deprecated and will be removed in the future. See the tutorial for concat at: https://anndata.readthedocs.io/en/latest/concatenation.html
  adata = pbmc8k.concatenate(pbmc4k)
/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/data/_built_in_data/_pbmc.py:81: FutureWarning: In the future `np.str` will be defined as the corresponding NumPy scalar.
  barcodes_metadata = pbmc_metadata["barcodes"].index.values.ravel().astype(np.str)
Traceback (most recent call last):
  File "/cluster/pixstor/joshitr-lab/zl7w2/scGPT/examples/finetune_integration.py", line 115, in <module>
    adata = scvi.data.pbmc_dataset()  # 11990 × 3346
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/data/_datasets.py", line 57, in pbmc_dataset
    return _load_pbmc_dataset(
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/data/_built_in_data/_pbmc.py", line 81, in _load_pbmc_dataset
    barcodes_metadata = pbmc_metadata["barcodes"].index.values.ravel().astype(np.str)
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/numpy/__init__.py", line 324, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'str'.
`np.str` was a deprecated alias for the builtin `str`. To avoid this error in existing code, use `str` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.str_` 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. Did you mean: 'std'?
Traceback (most recent call last):
  File "/cluster/pixstor/joshitr-lab/zl7w2/scGPT/examples/finetune_integration.py", line 115, in <module>
    adata = scvi.data.pbmc_dataset()  # 11990 × 3346
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/data/_datasets.py", line 57, in pbmc_dataset
    return _load_pbmc_dataset(
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/scvi/data/_built_in_data/_pbmc.py", line 81, in _load_pbmc_dataset
    barcodes_metadata = pbmc_metadata["barcodes"].index.values.ravel().astype(np.str)
  File "/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/site-packages/numpy/__init__.py", line 324, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'str'.
`np.str` was a deprecated alias for the builtin `str`. To avoid this error in existing code, use `str` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.str_` 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. Did you mean: 'std'?
�[1;34mwandb�[0m: 🚀 View run �[33mdrawn-waterfall-15�[0m at: �[34mhttps://wandb.ai/zl7w2/scGPT/runs/5d74gpgz�[0m
�[1;34mwandb�[0m: Find logs at: �[1;35m../../../../../cluster/pixstor/joshitr-lab/zl7w2/scGPT/examples/wandb/run-20250103_103607-5d74gpgz/logs�[0m
/mnt/pixstor/dbllab/zl7w2/miniconda3/envs/scgpt/lib/python3.10/tempfile.py:869: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/tmp8sgyo74m'>
  _warnings.warn(warn_message, ResourceWarning)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant