In the SDK on Github the requests module file is missing

The apiservice.py file imports requests module which is missing. Pls provide this module in SDK. here is the error:

File “C:\Users\pyPMClient-master\pmClient\apiService.py”, line 1, in
import requests
ModuleNotFoundError: No module named ‘requests’

Hi @9899281828

This is an external module/library. You need to install via pip. In the requirements.txt all the required modules are mentioned.

To install the modules in requirements.txt :

  1. cd to the directory where requirements.txt is located.
  2. activate your virtualEnv.
  3. run: pip install -r requirements.txt in your shell.

To directly install the mentioned package:

  1. cd to the directory.
  2. activate your virtualEnv.
  3. run: pip install requests in your shell.

Note: If you are using python3, use pip3.

2 Likes

Thank you Sachin for quick response and solution. I could fix this issue as you suggested but I am still not able to generate session using:
pm.generate_session(“your_request_token”)
the error is:
Traceback (most recent call last):
File “”, line 1, in
File “C:\NSE\pyPMClient-master\pmClient\pmClient.py”, line 41, in generate_session
response = self.api_call_helper(“access_token”, Requests.POST, params, request_body)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\NSE\pyPMClient-master\pmClient\apiService.py”, line 20, in api_call_helper
raise AttributeError(response.text)
AttributeError: {“status”:400,“message”:“Bad Request”,“error_code”:“PM_OPEN_API_400”}

Please help in fixing this issue also.

on authorization, I am getting the return URL like this:
http://www6.pmoney.com/?template=ARROW_3&tdfs=1&s_token=1111111111.1111111111&uuid=1111111111.1111111111&showDomain=1
*number replace by digit 1.

So can you pls confirm if my “request_token” is 1111111111.1111111111

Hi @9899281828

The request token is incorrect, it is present in the return url with key name requestToken

Eg:

Here return url is google.com

Thank you very much Sachin for the great help :slight_smile: