orionx-api-client icon indicating copy to clipboard operation
orionx-api-client copied to clipboard

AttributeError: 'module' object has no attribute 'Session'

Open DannyAndres opened this issue 6 years ago • 1 comments

I'm trying to use "examples/using_batcher.py" example with my keys and i'm not getting nowhere, I'm getting the following error:

Traceback (most recent call last):
  File "query.py", line 9, in <module>
    client = client(api_key, secret_key, use_batching=True)
  File "/home/danny/.local/lib/python2.7/site-packages/orionxapi/client.py", line 15, in client
    timeout=timeout
  File "/home/danny/.local/lib/python2.7/site-packages/orionxapi/transport.py", line 20, in __init__
    super(CustomBatchTransport, self).__init__(*args, **kwargs)
  File "/home/danny/.local/lib/python2.7/site-packages/pygql/transport/batch_transport.py", line 58, in __init__
    self.session = requests.Session()
AttributeError: 'module' object has no attribute 'Session'

I'm starting to think that this error has something to do with requests, so if i print the module path i get:

<module 'pygql.transport.requests' from '/home/danny/.local/lib/python2.7/site-packages/pygql/transport/requests.pyc'>

but, does not suppouse to be this one:

<module 'requests' from '/home/danny/.local/lib/python2.7/site-packages/requests/__init__.pyc'>

because if i try to use requests.Session() has to be this object, right ?

<requests.sessions.Session object at 0x7f2389f8a410>

so i think maybe there is something going on with " import requests " that don't recognize the file path or something like that, but still, if I try to use the requests that is outside of pygql i'm getting other error so maybe it's just me that i'm not doing thing properly, will be great if you could help to solve this

sorry :) i'm still a noob and i'm trying to understand how to fix my issue, maybe is not just puting keys and there is something that i'm not doing, thanks

DannyAndres avatar Jun 15 '18 02:06 DannyAndres