Skip to content

ImportError with NeighborSampler in PyG: requires 'pyg-lib' or 'torch-sparse' even when 'pyg-lib' is installed #7866

Closed Answered by KamilZPWr
KamilZPWr asked this question in Q&A
Discussion options

You must be logged in to vote

I executed my code on a Linux-based virtual machine, while my local system runs on Windows. It slipped my attention that there was a slight version discrepancy in PyG between the two setups. The error I encountered on the virtual machine stemmed from the fact that the 'if' condition was expanded. Here's the code for reference:

# TODO Support induced subgraph sampling in `pyg-lib`.
if (torch_geometric.typing.WITH_PYG_LIB and self.subgraph_type != SubgraphType.induced):

Given that my graph was of the 'induced' type, this led to the error. My confusion was amplified because, in my local version of PyG on Windows, only the typing check was present in this line.

I appreciate your assistance in…

Replies: 9 comments 15 replies

Comment options

You must be logged in to vote
1 reply
@KamilZPWr
Comment options

Comment options

You must be logged in to vote
4 replies
@asmit203
Comment options

@rusty1s
Comment options

@KamilZPWr
Comment options

@Muyiiiii
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by KamilZPWr
Comment options

You must be logged in to vote
6 replies
@Joe-Hall-Lee
Comment options

@meredith-zeng
Comment options

@hmam9090
Comment options

@CottePutman
Comment options

@ankursworld
Comment options

Comment options

You must be logged in to vote
1 reply
@alarso16
Comment options

Comment options

You must be logged in to vote
2 replies
@rusty1s
Comment options

@devinbost
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@AKookani
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment