The simple command usually works:
pip install yahoo-finance
If this does not work usually anaconda has good packages that work with each other:
conda install yahoo-finance
Things that could introduce problems that are not solved by the above commands:
- Python is not properly installed. Reinstall python. I would recommend using anaconda to install Python, because it has a lot of libraries pre-installed that do not conflict with each other.
- Problems with the internet connection. Make sure that you have connection to the internet and specifically to pypi website (https://pypi.org/)
- You do not have ssl libraries installed and that does not allow you to connect using https. Install ssl libraries.
Based on the error I would recommend reinstalling Python with Anaconda and checking your internet connection.
pip install yahoo-finance
– Caravel