question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Missing ``class_resolver`` dependency

See original GitHub issue

šŸ˜µ Describe the installation problem

Recently Iā€™m receiving the following error caused by loading a GNN layer object from PyG due to a missing dependency on class_resolver.

  File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/torch_geometric/nn/models/basic_gnn.py", line 60, in __init__
    from class_resolver.contrib.torch import activation_resolver
ModuleNotFoundError: No module named 'class_resolver'

The issue is resolved by simply installing this (pip install class_resolver). I also notice that this requirement is included in the ā€œfullā€ install requirements and will be installed automatically if I do pip install torch-geometric [full]. However, Iā€™m using the latest PyG on github in my github actions pip install git+https://github.com/pyg-team/pytorch_geometric.git. Iā€™m wondering would it be possible to pass the [full] option to pip in this case? I tried pip install git+https://github.com/pyg-team/pytorch_geometric.git [full] and it did not work:

ERROR: Invalid requirement: '[full]'

Environment

  • PyG version: latest (pip install git+https://github.com/pyg-team/pytorch_geometric)
  • PyTorch version: 1.9.0
  • OS: ubuntu-latest
  • Python version: 3.8
  • CUDA/cuDNN version: CPU
  • How you installed PyTorch and PyG (conda, pip, source): pip
  • Any other relevant information (e.g., version of torch-scatter):

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
rusty1scommented, Mar 26, 2022

Currently, class_resolver is used inside MLP and basic GNN models for resolving activation functions from PyTorch. We could consider integrating this functionality directly inside PyG to avoid the extra dependency. Otherwise, falling back to pip install class-resolver is the only workaround I am aware of.

Pinging @cthoyt here as well.

3reactions
rusty1scommented, Mar 4, 2022

This should work:

pip install git+https://github.com/pyg-team/pytorch_geometric.git#egg=torch-geometric[full]

Alternatively, you can just install class-resolver after installing PyG:

pip install "git+https://github.com/pyg-team/pytorch_geometric.git
pip install class-resolver
Read more comments on GitHub >

github_iconTop Results From Across the Web

If a class dependency is missing, how can I determine which ...
From this answer, I learned that the class can likely be found, but not loaded, due to missing dependencies. Aside from manually decompilingĀ ......
Read more >
ClassResolver (archunit 0.9.1 API) - javadoc.io
Dependency , the ClassResolver will decide how this dependency should be treated, ... ArchUnit will call this method, to resolve any missing JavaClassesĀ ......
Read more >
Dependency Injection Syntax - Drupal Answers
I'm trying to build a simple module (to learn DI) to return the current user ID, and and apparently I'm missing something in...
Read more >
Unable to enable Upgrade_Status even though installed via ...
... I click to enable, I get an error that it is missing dependencies. ... does not exist. in Drupal\Core\DependencyInjection\ClassResolver-Ā ...
Read more >
ArchUnit User Guide
That is, ArchUnit can check dependencies between packages and classes, ... if ArchUnit fails to determine the location of a missing class from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found