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 with the latest 0.5.0 version and the documentation example #88

Closed
bozhodimitrov opened this issue May 16, 2020 · 14 comments
Labels
type: question or discussion Issue discussing or asking a question about gql

Comments

@bozhodimitrov
Copy link

Reproduction:

$ virtualenv env
$ . .\env\Scripts\activate
$ pip install aiohttp gql
$ python
>>> from gql.transport.aiohttp import AIOHTTPTransport
Traceback (most recent call last):
  File ".\test_gql.py", line 1, in <module>
    from gql.transport.aiohttp import AIOHTTPTransport
ModuleNotFoundError: No module named 'gql.transport.aiohttp'

Windows 10 1909
Python version 3.8.x
gql version 0.5.0 (latest available version in PyPI)

@bozhodimitrov
Copy link
Author

NVM, the docs on master require the latest dev version.

@Cito
Copy link
Member

Cito commented May 16, 2020

Yes, sorry for the confusion. New versions will be released tomorrow, including an alpha release with the new functionality.

@KingDarBoja KingDarBoja added the type: question or discussion Issue discussing or asking a question about gql label Jun 29, 2020
@chelseatroy
Copy link

Hi! I'm having this exact same problem and I just installed gql today. Any ideas what's up?

@GraphtyLove
Copy link

Same here.

@lukasschmit
Copy link

Same!

@lightstrike
Copy link

The README was confusing for me - I got this running by specifying the alpha version, ie for pipenv install gql[all]==3.0.0a6

@MindaugasBernatavicius
Copy link

MindaugasBernatavicius commented Jul 1, 2021

Same for me, using Python 3.9.0

pip install aiohttp gql
from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport

# Select your transport with a defined url endpoint
transport = AIOHTTPTransport(url="https://countries.trevorblades.com/")

# Create a GraphQL client using the defined transport
client = Client(transport=transport, fetch_schema_from_transport=True)

# Provide a GraphQL query
query = gql(
    """
    query getContinents {
      continents {
        code
        name
      }
    }
"""
)

# Execute the query on the transport
result = client.execute(query)
print(result)
Traceback (most recent call last):
  File "C\..\rest_demo.py", line 2, in <module>
    from gql.transport.aiohttp import AIOHTTPTransport
ModuleNotFoundError: No module named 'gql.transport.aiohttp'

@leszekhanusz
Copy link
Collaborator

Please check the installation instructions

@roiweinreb
Copy link

Having the same issue. Tried it today.

@leszekhanusz
Copy link
Collaborator

Did you follow the installation instructions and used pip install --pre gql[all] ?

@roiweinreb
Copy link

@leszekhanusz it works, thanks!

@yenicelik
Copy link

does not work for me

@PaulApivat
Copy link

This worked for me:

pip3 install 'gql[all]==3.0.0b0'

  • used quotes because my machine uses zsh instead of bash
  • identifying most recent version of gql

@sarastinishi
Copy link

For those who still experiencing the same issue and using python poetry, you can use the following dependency spec in your pyproject.toml:

gql = {extras = ["all"], version = "~=3.0.0rc0", allow-prereleases = true}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about gql
Projects
None yet
Development

No branches or pull requests