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

Unable to login. Exception: Please configure your keys in keys.conf #50

Open
kumarchinmaya116 opened this issue Apr 18, 2021 · 5 comments

Comments

@kumarchinmaya116
Copy link

  • 5paisa Python SDK version:
  • Python version:
  • Operating System:

Description

The first time I tried to login, it showed a logged in!! message. But thereafter, I am not able to login. every time i run the script, I get the error: Exception: Please configure your keys in keys.conf.
I have saved my keys in keys.conf file as per the instruction and saved the file in the directory where i have kept the script. Still it shows the same error.

What I Did

from py5paisa import FivePaisaClient
client = FivePaisaClient(email="k*****************[email protected]", passwd="***********", dob="********")
client.login()
( in place of * i have used my credentials)

The output:
Traceback (most recent call last):

  File "C:\Users\dhriti\Anaconda3\envs\trading\lib\site-packages\py5paisa\conf.py", line 9, in <module>
    section = config["KEYS"]

  File "C:\Users\dhriti\Anaconda3\envs\trading\lib\configparser.py", line 958, in __getitem__
    raise KeyError(key)

KeyError: 'KEYS'


During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "<ipython-input-1-7999cee77a8c>", line 1, in <module>
    from py5paisa import FivePaisaClient

  File "C:\Users\dhriti\Anaconda3\envs\trading\lib\site-packages\py5paisa\__init__.py", line 1, in <module>
    from py5paisa.py5paisa import FivePaisaClient

  File "C:\Users\dhriti\Anaconda3\envs\trading\lib\site-packages\py5paisa\py5paisa.py", line 2, in <module>
    from .auth import EncryptionClient

  File "C:\Users\dhriti\Anaconda3\envs\trading\lib\site-packages\py5paisa\auth.py", line 8, in <module>
    from .conf import ENCRYPTION_KEY

  File "C:\Users\dhriti\Anaconda3\envs\trading\lib\site-packages\py5paisa\conf.py", line 11, in <module>
    raise Exception("Please configure your keys in keys.conf")

Exception: Please configure your keys in keys.conf

Has anyone faced similar issue? If so, what can be done?

Regards
Chinmaya

@coder-amogh
Copy link

Did you read this?
Did you try to run through command line? I think the working directory should be the same as where the file is stored.

@pawarvijay
Copy link

@coder-amogh @kumarchinmaya116

the api keys link is wrong in documentation
i have raised MR for it Here #58

@bpsrinivas
Copy link

bpsrinivas commented Jul 3, 2021

File "C:\Users\pbalakr3\IdeaProjects\PythonProjects\src\stockanalysis\5paisa\broker.py", line 1, in
from py5paisa import FivePaisaClient
File "C:\Users\pbalakr3\IdeaProjects\PythonProjects\venv\lib\site-packages\py5paisa_init_.py", line 1, in
from py5paisa.py5paisa import FivePaisaClient
File "C:\Users\pbalakr3\IdeaProjects\PythonProjects\venv\lib\site-packages\py5paisa\py5paisa.py", line 3, in
from .auth import EncryptionClient
File "C:\Users\pbalakr3\IdeaProjects\PythonProjects\venv\lib\site-packages\py5paisa\auth.py", line 8, in
from .conf import ENCRYPTION_KEY
File "C:\Users\pbalakr3\IdeaProjects\PythonProjects\venv\lib\site-packages\py5paisa\conf.py", line 11, in
raise Exception("Please configure your keys in keys.conf")
Exception: Please configure your keys in keys.conf

sometimes it works .. then it stops working ... The keys.conf file is present in the same directory

@Dhruvt75
Copy link

i have also same problem can anyone solve this

@Parthiban-Sampath
Copy link

First, check the working directory of your program.
In the same directory, create keys.conf file with the same format as in https://github.com/5paisa/py5paisa.
Then try login.

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

No branches or pull requests

6 participants