bowang-lab / scGPT

https://scgpt.readthedocs.io/en/latest/
MIT License
982 stars 184 forks source link

Installation Issues #232

Open liusi2019 opened 1 month ago

liusi2019 commented 1 month ago

Dear scGPT Team,

Thanks a lot for your amazing work!

When trying to install the scGPT into a conda environment with R.3.6.1 and Python 3.7.13 using this command line (after activating the built conda environment named "scGPT_env"):

anaconda3/envs/scGPT_env/bin/pip install scgpt "flash-attn<1.0.5"

I ran into these following message:

Collecting scgpt
  Downloading scgpt-0.2.1-py3-none-any.whl (829 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 829.2/829.2 kB 7.3 MB/s eta 0:00:00
Collecting flash-attn<1.0.5
  Downloading flash_attn-1.0.4.tar.gz (2.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 35.4 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "/home/username/anaconda3/envs/scGPT_env/lib/python3.7/site-packages/importlib_metadata/_compat.py", line 9, in <module>
          from typing import Protocol
      ImportError: cannot import name 'Protocol' from 'typing' (/home/username/anaconda3/envs/scGPT_env/lib/python3.7/typing.py)

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 36, in <module>
    File "<pip-setuptools-caller>", line 14, in <module>
    File "/home/username/anaconda3/envs/scGPT_env/lib/python3.7/site-packages/setuptools/__init__.py", line 18, in <module>
      from setuptools.dist import Distribution
    File "/home/username/anaconda3/envs/scGPT_env/lib/python3.7/site-packages/setuptools/dist.py", line 33, in <module>
      from ._importlib import metadata
    File "/home/username/anaconda3/envs/scGPT_env/lib/python3.7/site-packages/setuptools/_importlib.py", line 39, in <module>
      disable_importlib_metadata_finder(metadata)
    File "/home/username/anaconda3/envs/scGPT_env/lib/python3.7/site-packages/setuptools/_importlib.py", line 12, in disable_importlib_metadata_finder
      import importlib_metadata
    File "/home/username/anaconda3/envs/scGPT_env/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 17, in <module>
      from . import _adapters, _meta
    File "/home/username/anaconda3/envs/scGPT_env/lib/python3.7/site-packages/importlib_metadata/_meta.py", line 1, in <module>
      from ._compat import Protocol
    File "/home/username/anaconda3/envs/scGPT_env/lib/python3.7/site-packages/importlib_metadata/_compat.py", line 11, in <module>
      from typing_extensions import Protocol  # type: ignore
    File "/home/username/.local/lib/python3.9/site-packages/typing_extensions.py", line 916
      def TypedDict(typename, fields=_marker, /, *, total=True, **kwargs):
                                              ^
  SyntaxError: invalid syntax
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

May I know whether there is any known solution for this issue? For example, is Python 3.7.13 still a recommended version of Python, or any other factors? Multiple ways have been tried for the installation, but they each ran into different errors that seem to relate to dependency issues. It will be nice to have some guidelines!

Thank you very much!

subercui commented 1 month ago

Hi, thank you for the interest in our work! You can try newer version of python. In the meantime, flash-attn is an optional dependency now. Especially if you work with pytorch>=2.1, you probably will not need flash-attn