ModuleNotFoundError: No module named 'alpha_vantage'

2.9k views Asked by At
import pandas as pd
from aplha_vantage.timeseries import TimeSeries
import time
api_key = '*************'

ts = TimeSeries(key=api_key, output_format='pandas')
data, meta_data = ts.get_intraday(symbol='MSFT', interval = '1min', output_size = 'full')
print(data)

When I try to pull the data into the terminal it gives me a ModuleNotFoundError on alpha_vantage even though I had installed it using terminal.

I'm using pycharm and python 3.9

3

There are 3 answers

0
Tamil Selvan S On

It depends on what interpreter pycharm is using. Do this:

  1. Open Pycharm

  2. Hit "file" and look for "settings" or "other settings"

  3. Click then then look for something with "preferences"

  4. Now look for "project interpreter"

You now you can do one of two things

  1. Add the package yourself to the interpreter

    a. There is a little plus button at the bottom you can hit, and add "alpha-vantage"

  2. Make the pycharm interpreter the same as your command line interpreter (the thing you did pip install alpha-vantage on)

    b. You can find out what interpreter you're using with which python on the command line, and just make them the same.

0
Rundaskill On

It is because it has a virtual environment and you are installing it outside.

If I create a project in pycharm, this step will work.

  1. Click the interpreter in the bottom right corner of the project and select 'Interpreter Settings' enter image description here

  2. click in icon more enter image description here

  3. Write the name of the library and click in install package enter image description here

0
mino On

you can enter virtual env then excute pip list to check if installed