Home > Software engineering >  IndentationError: expected an indented block in requests.adapter
IndentationError: expected an indented block in requests.adapter

Time:10-04

import pandas_datareader
import math
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layers import Dense, LSTM
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')

this is the error am getting. what could be the problem?

 File "C:\Users\58949566886849568\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas_datareader\av\__init__.py", line 5, in <module>
    from pandas_datareader._utils import RemoteDataError
  File "C:\Users\58949566886849568\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas_datareader\_utils.py", line 4, in <module>
    import requests
  File "C:\Users\58949566886849568\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\__init__.py", line 121, in <module>
    from .api import request, get, head, post, patch, put, delete, options
  File "C:\Users\58949566886849568\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\api.py", line 13, in <module>
    from . import sessions
  File "C:\Users\58949566886849568\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\sessions.py", line 28, in <module>
    from .adapters import HTTPAdapter
  File "C:\Users\58949566886849568\AppData\Local\Programs\Python\Python38\lib\site-packages\requests\adapters.py", line 453
    else:
    ^
IndentationError: expected an indented block

CodePudding user response:

Your requests package seems to be corrupted as there seem to be issues within the package itself.

Try reinstalling the package:

pip uninstall requests
pip install requests
  • Related