bigscience-workshop / Megatron-DeepSpeed

Ongoing research training transformer language models at scale, including: BERT & GPT-2
Other
1.3k stars 211 forks source link

ModuleNotFoundError: No module named 'torch' when run 'pip install -e .', but pytorch exists #389

Closed SeekPoint closed 1 year ago

SeekPoint commented 1 year ago

(gh_Megatron-DeepSpeed) amd00@MZ32-00:~/llm_dev/Megatron-DeepSpeed$ python Python 3.10.12 (main, Jul 5 2023, 19:22:19) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import torch quit() (gh_Megatron-DeepSpeed) amd00@MZ32-00:~/llm_dev/Megatron-DeepSpeed$ pip install -e . Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Obtaining file:///home/amd00/llm_dev/Megatron-DeepSpeed Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build editable ... error error: subprocess-exited-with-error

× Getting requirements to build editable did not run successfully. │ exit code: 1 ╰─> [21 lines of output] Traceback (most recent call last): File "/home/amd00/anaconda3/envs/gh_Megatron-DeepSpeed/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in main() File "/home/amd00/anaconda3/envs/gh_Megatron-DeepSpeed/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/home/amd00/anaconda3/envs/gh_Megatron-DeepSpeed/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 132, in get_requires_for_build_editable return hook(config_settings) File "/tmp/pip-build-env-0cfsc787/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 450, in get_requires_for_build_editable return self.get_requires_for_build_wheel(config_settings) File "/tmp/pip-build-env-0cfsc787/overlay/lib/python3.10/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-0cfsc787/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-0cfsc787/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 487, in run_setup super(_BuildMetaLegacyBackend, File "/tmp/pip-build-env-0cfsc787/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup exec(code, locals()) File "", line 25, in File "/home/amd00/llm_dev/Megatron-DeepSpeed/megatron/init.py", line 15, in import torch ModuleNotFoundError: No module named 'torch' [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 editable did not run successfully. │ exit code: 1 ╰─> See above for output.

zhaowenyi7 commented 9 months ago

I got same error, how did you solve it?

Eugene29 commented 3 weeks ago

same