I try to run a script through TextWrangler
I have Python 3.6 installed on my Mac OS X. When I wrote my script I wrote the following
import datetime as dt
import matplotlib.pyplot as plt
from matplotlib import style
import pandas as pd
import pandas_datareader.data as web
but then when I run it, I get the following error message:
Traceback (most recent call last): File "/Users/YoavPoni/Documents/Python/TextWranglerRunTemp-sen.py", line 4, in import matplotlib.pyplot as plt ModuleNotFoundError: No module named 'matplotlib'
Any suggestions?
You might need to change the Python you are invoking when running the program. Currently, you may be using the standard Python that comes from Mac OS X (that does not have matplotlib installed). What you need to do is run your code with the Python that has matplotlib installed in its library.
You should include a line at the beginning of your Python code like
#!/usr/bin/env python
With /usr/bin/env
being the full path to the Python interpreter with matplotlib installed.