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

ModuleNotFoundError: No module named 'torch' while installing torch-scatter using pip on MacOS #424

Open
atharvabagde opened this issue Mar 2, 2024 · 3 comments

Comments

@atharvabagde
Copy link

atharvabagde commented Mar 2, 2024

I am unable to install torch-scatter using the following command : pip install torch-scatter -f https://data.pyg.org/whl/torch-2.1.0+cpu.html

Getting the following error:

(project_990) atharvbagde@Atharvs-Laptop ~ % pip install torch-scatter -f https://data.pyg.org/whl/torch-2.1.0+cpu.html
Looking in links: https://data.pyg.org/whl/torch-2.1.0+cpu.html
Collecting torch-scatter
Using cached torch_scatter-2.1.2.tar.gz (108 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
╰─> [17 lines of output]
Traceback (most recent call last):
File "/Users/atharvbagde/.pyenv/versions/3.10.4/envs/project_990/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/Users/atharvbagde/.pyenv/versions/3.10.4/envs/project_990/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 "/Users/atharvbagde/.pyenv/versions/3.10.4/envs/project_990/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/var/folders/rh/0y4zwnyd49l6pmndmmg3lh7h0000gn/T/pip-build-env-u4d8oq9d/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/private/var/folders/rh/0y4zwnyd49l6pmndmmg3lh7h0000gn/T/pip-build-env-u4d8oq9d/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/private/var/folders/rh/0y4zwnyd49l6pmndmmg3lh7h0000gn/T/pip-build-env-u4d8oq9d/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 487, in run_setup
super().run_setup(setup_script=setup_script)
File "/private/var/folders/rh/0y4zwnyd49l6pmndmmg3lh7h0000gn/T/pip-build-env-u4d8oq9d/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "", line 8, in
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 wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

Python Virtual env details
Python: 3.10.4
pip: 24.0
Torch: 2.1.0 (installed using pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0)
Torch-geometric: 2.5.0 (installed using pip install torch_geometric)

MacOS M2 chip

Let me know if any other details are required

@atharvabagde atharvabagde changed the title ModuleNotFoundError: No module named 'torch' while installing torch-scatter using pip ModuleNotFoundError: No module named 'torch' while installing torch-scatter using pip on MacOS Mar 2, 2024
@rusty1s
Copy link
Owner

rusty1s commented Mar 3, 2024

Can you try to install via

git clone https://github.com/rusty1s/pytorch_scatter.git
python setup.py install

@atharvabagde
Copy link
Author

Yes, this does work!
Are there any changes I need to make in order to install via pip? Because I am able to install simply via pip on Colab but it fails on my local Mac

@rusty1s
Copy link
Owner

rusty1s commented Mar 4, 2024

We would have to bring rusty1s/pytorch_cluster#208 also to torch-scatter.

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

2 participants