Skip to content

ImportError: The GraphQL client could not be initialized because the gql dependencies are not installed #3137

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

Open
kalavt opened this issue Feb 17, 2025 · 3 comments
Labels

Comments

@kalavt
Copy link

kalavt commented Feb 17, 2025

Description of the problem, including code/CLI snippet

ImportError: The GraphQL client could not be initialized because the gql dependencies are not installed. Install them with 'pip install python-gitlab[graphql]'
pip install python-gitlab[graphql]

$ pip install python-gitlab[graphql]
zsh: no matches found: python-gitlab[graphql]

Expected Behavior

pip install python-gitlab[graphql] success

Actual Behavior

no matches found: python-gitlab[graphql]

Specifications

  • python-gitlab version: 5.6.0
  • Gitlab server version (or gitlab.com): 17.6
@nejch
Copy link
Member

nejch commented Feb 17, 2025

Hi @kalavt! Some shells, including zsh, will probably need quotes around the pip install when using extras:

pip install 'python-gitlab[graphql]'

This is more of a shell syntax issue, but maybe we could just quote our example in the error message.

@nejch nejch added the docs label Feb 17, 2025
@kalavt
Copy link
Author

kalavt commented Feb 17, 2025

Oh, got it. sorry for the confusion, I've over come it by
pip install gql
should be the same

@nejch
Copy link
Member

nejch commented Feb 17, 2025

@kalavt generally that should work, but the reason we have our extras there is to ensure version compatibility. But pip will probably install a compatible version if you already have python-gitlab installed 👍 Either way, it's best to use a python project manager to properly track your dependencies (uv, hatch, poetry, ..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants