Pandas_datareader error. No module named 'distutils'

394 views Asked by At

I am using python 3.12 on Pycharm and I have been trying to use the pandas_datareader module. After doing "pip install pandas_datareader" in the Command Prompt, I went to the documentation to look at where to begin. After trying what they said to do, I got an error saying "No module named 'distutils'"

import pandas_datareader as pdr

pdr.get_data_fred('AAPL')

That is the code I used

2

There are 2 answers

0
V. Nguyen On

try pip install setuptools (or pipenv)

0
jenkitay On

Try using an earlier version of python. distutils was deprecated in python 3.10, and removed in python 3.12. https://docs.python.org/3.12/whatsnew/3.12.html#distutils