scGPT icon indicating copy to clipboard operation
scGPT copied to clipboard

scGPT installation error

Open BioAmelie opened this issue 2 years ago • 7 comments

Hi,

I am trying to use scGPT for my scRNA-seq annotation, but I met some installation error as follwoing: Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [41 lines of output] /home/songmf/anaconda3/envs/scgpt/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/songmf/anaconda3/envs/scgpt/lib/R/lib/../../libgomp.so.1: undefined reference to clock_getres@GLIBC_2.17' /home/songmf/anaconda3/envs/scgpt/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/songmf/anaconda3/envs/scgpt/lib/R/lib/libR.so: undefined reference to __fdelt_chk@GLIBC_2.15' /home/songmf/anaconda3/envs/scgpt/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/songmf/anaconda3/envs/scgpt/lib/R/lib/../.././libtinfow.so.6: undefined reference to __poll_chk@GLIBC_2.16' /home/songmf/anaconda3/envs/scgpt/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/songmf/anaconda3/envs/scgpt/lib/R/lib/../../libgomp.so.1: undefined reference to aligned_alloc@GLIBC_2.16' /home/songmf/anaconda3/envs/scgpt/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/songmf/anaconda3/envs/scgpt/lib/R/lib/libR.so: undefined reference to memcpy@GLIBC_2.14' /home/songmf/anaconda3/envs/scgpt/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/songmf/anaconda3/envs/scgpt/lib/liblzma.so: undefined reference to clock_gettime@GLIBC_2.17' /home/songmf/anaconda3/envs/scgpt/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/songmf/anaconda3/envs/scgpt/lib/R/lib/libR.so: undefined reference to timespec_get@GLIBC_2.16' /home/songmf/anaconda3/envs/scgpt/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/songmf/anaconda3/envs/scgpt/lib/R/lib/../../libgomp.so.1: undefined reference to secure_getenv@GLIBC_2.17' collect2: error: ld returned 1 exit status Traceback (most recent call last): File "/tmp/pip-build-env-fkvx7_tb/overlay/lib/python3.7/site-packages/setuptools/_distutils/unixccompiler.py", line 266, in link self.spawn(linker + ld_args) File "/tmp/pip-build-env-fkvx7_tb/overlay/lib/python3.7/site-packages/setuptools/_distutils/ccompiler.py", line 1041, in spawn spawn(cmd, dry_run=self.dry_run, **kwargs) File "/tmp/pip-build-env-fkvx7_tb/overlay/lib/python3.7/site-packages/setuptools/_distutils/spawn.py", line 71, in spawn "command {!r} failed with exit code {}".format(cmd, exitcode) distutils.errors.DistutilsExecError: command '/home/songmf/anaconda3/envs/scgpt/bin/x86_64-conda-linux-gnu-cc' failed with exit code 1

  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/songmf/anaconda3/envs/scgpt/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
      main()
    File "/home/songmf/anaconda3/envs/scgpt/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/songmf/anaconda3/envs/scgpt/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-fkvx7_tb/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-fkvx7_tb/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-fkvx7_tb/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 137, in <module>
    File "<string>", line 119, in get_r_c_extension_status
    File "<string>", line 87, in get_c_extension_status
    File "/tmp/pip-build-env-fkvx7_tb/overlay/lib/python3.7/site-packages/setuptools/_distutils/ccompiler.py", line 794, in link_executable
      target_lang,
    File "/tmp/pip-build-env-fkvx7_tb/overlay/lib/python3.7/site-packages/setuptools/_distutils/unixccompiler.py", line 268, in link
      raise LinkError(msg)
  distutils.errors.LinkError: command '/home/songmf/anaconda3/envs/scgpt/bin/x86_64-conda-linux-gnu-cc' failed with exit code 1
  [end of output]

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

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

Do you have some comments on it? I am extremely appreaciate it!

BioAmelie avatar Sep 23 '23 08:09 BioAmelie

Hi, this looks some issue with pip install. I didn't find which package was related. Can you show several more lines before the copied messages, it should say this happens when installing which package.

subercui avatar Sep 24 '23 02:09 subercui

hi, I think I've met the same problem, and these lines are what you asked for: Using cached https://pypi.tuna.tsinghua.edu.cn/packages/30/dc/d9748ec2b61b6a1fcbaff3891961297c83cfa34c9f9984761fb6f6ae65d0/rpy2-3.5.14.tar.gz (219 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [55 lines of output] @subercui it seems to be related with gnu when compiling?

zhiqiang-git avatar Dec 06 '23 15:12 zhiqiang-git

I can tell what I have done to able to run at least annotation and integration notebooks successfully.

I am running experiments on a server: Driver Version: 525.60.13 CUDA Version: 12.0

conda create --name scgpt_ann python=3.10 r-base r-devtools conda activate scgpt_ann pip install scgpt pip install ipython ( you can run without this, if you encounter a problem related to ipython, then install it, very trivial error)

Finally, using pip, install all the packages in develeopment section(in pyproject.toml in repo) too. (I am not sure if it is necessary or not, but in this form it works.) After that, everything worked well for me.

Additionally, if you would like to work with fast-attn, then follow this:

pip install packaging pip install flash-attn==1.0.4 (if your driver is old, probably it will not install)

In integration task, if your numpy is above 1.20.0, you will probably encounter the problem like np.str, np.bool. To solve this error, go to the scvi dataset creation module, replace np.str and np.bool with str and bool.

kocemir avatar Feb 24 '24 09:02 kocemir

@kocemir have you tried perturbation example without fast_attn? You can't load the model without that.

sepidism avatar Mar 27 '24 20:03 sepidism

hi, have you solve the problem? I've met the same problem @zhiqiang-git note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for flash-attn Running setup.py clean for flash-attn Failed to build flash-attn ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (flash-attn)

Susan920715 avatar Oct 25 '24 06:10 Susan920715

@Susan920715 Hi, actually I used the docker in the end, which was fine to use. I didn't solve these problems when I tried to set the environment on my own.

zhiqiang-git avatar Nov 04 '24 06:11 zhiqiang-git