'ModuleNotFoundError: No module named 'fyers_api'

I am running the below code to connect fyers API:

from fyers_api import accessToken
from fyers_api import fyersModel

app_id = "app_id"
app_secret = "secret_id"
app_session = accessToken.SessionModel(app_id, app_secret)
response = app_session.auth()

But still getting error:

ModuleNotFoundError: No module named 'fyers_api'

Please help to resolve issue. I did install fyers_api module. pip install fyers_api



Solution 1:[1]

Since this is Python 3 (because ModuleNotFoundError is specific to Python 3), you should be using pip3 instead of pip to install packages:

pip3 install fyers_api

pip install fyers_api will install it for Python 2.

Solution 2:[2]

Download fyers api package from here

For Anaconda-3 run below command from the anaconda prompt.

pip install <path to the downloaded package>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ForceBru
Solution 2