You have two pythons installed on your machine, one is the standard python that comes with Mac OSX and the second is the one you installed with ports (this is the one that has matplotlib
installed in its library, the one that comes with macosx does not).
/usr/bin/python
Is the standard mac python and since it doesn’t have matplotlib
you should always start your script with the one installed with ports.
If python your_script.py
works then change the #!
to:
#!/usr/bin/env python
Or put the full path to the python interpreter that has the matplotlib
installed in its library.
Related Posts:
- What is the difference between importing matplotlib and matplotlib.pyplot?
- ImportError: No module named matplotlib.pyplot
- What is the necessity of plt.figure() in matplotlib?
- Is there a way to create multiline comments in Python?
- How to update/upgrade a package using pip?
- How can I remove a specific item from an array?
- How do I update\upgrade pip itself from inside my virtual environment?
- IndexError: too many indices for array
- numpy array: IndexError: too many indices for array
- Python3 – ModuleNotFoundError: No module named ‘numpy’
- How do I specify new lines on Python, when writing on files?
- What is the purpose of the return statement?
- bash: pip: command not found
- How do I check what version of Python is running my script?
- Converting integer to string in Python
- deleting file if it exists; python
- Reverse a string in Python
- Python for-in loop preceded by a variable
- Python Linked List
- What does if __name__ == “__main__”: do?
- How to print without a newline or space
- Error: ‘int’ object is not subscriptable – Python
- How to measure elapsed time in Python?
- How to uninstall Anaconda completely from macOS
- Python: Start and stop timer [duplicate]
- Does Python have a ternary conditional operator?
- not all arguments converted during string formatting.. NO % variables
- How do I install opencv using pip?
- TypeError: ‘builtin_function_or_method’ object is not subscriptable
- How do I compare two strings in python?
- Purpose of “%matplotlib inline”
- Curve curvature in numpy
- ImportError: No module named sklearn.cross_validation
- How can I prevent the TypeError: list indices must be integers, not tuple when copying a python list to a numpy array?
- python – how to get the data from an plt.imshow()?
- What are data classes and how are they different from common classes?
- Tensorflow import error: No module named ‘tensorflow’
- Python random function
- Converting NumPy array into Python List structure?
- Converting string into datetime
- How do you get the logical xor of two variables in Python?
- ValueError: could not convert string to float: id
- Pip freeze vs. pip list
- The difference between comparison to np.nan and isnull()
- Best way to return multiple values from a function? [closed]
- RuntimeWarning: invalid value encountered in divide
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- ValueError: operands could not be broadcast together with shapes (5,) (30,)
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- matplotlib savefig() plots different from show()
- How do I draw a grid onto a plot in Python?
- No handles with labels found to put in legend
- Plot logarithmic axes with matplotlib in python
- How can I plot a confusion matrix? [duplicate]
- pandas DataFrame “no numeric data to plot” error
- Permission denied error by installing matplotlib
- Updating matplotlib in virtualenv with pip
- How do you change the size of figures drawn with Matplotlib?
- Matplotlib automatic legend outside plot
- Add Legend to Seaborn point plot
- A tool to convert MATLAB code to Python
- matplotlib error – no module named tkinter
- TypeError: ‘DataFrame’ object is not callable
- Improve subplot size/spacing with many subplots in matplotlib
- How do I plot only a table in Matplotlib?
- Python equivalent to ‘hold on’ in Matlab
- Overcome ValueError for empty array
- How can I convert an RGB image into grayscale in Python?
- Using %matplotlib notebook after %matplotlib inline in Jupyter Notebook doesn’t work
- Display image as grayscale using matplotlib
- Create own colormap using matplotlib and plot color scale
- Why matplotlib does not plot?
- How to plot time series in python
- reducing number of plot ticks
- How to increase plt.title font size?
- How to add title to seaborn boxplot
- ValueError: x and y must be the same size
- ValueError: Unknown projection ‘3d’ (once again)
- How to change plot background color?
- Display an image with Python
- Meaning of @classmethod and @staticmethod for beginner?
- Linear regression with matplotlib / numpy
- How to save a Seaborn plot into a file
- Scatter plot colorbar – Matplotlib
- matplotlib: how to draw a rectangle on image
- bbox_to_anchor and loc in matplotlib
- matplotlib: RuntimeError: Python is not installed as a framework
- urllib2.HTTPError: HTTP Error 403: Forbidden
- Python/Django: log to console under runserver, log to file under Apache
- TensorFlow not found using pip
- RuntimeError: Invalid DISPLAY variable
- When I use matplotlib in jupyter notebook,it always raise ” matplotlib is currently using a non-GUI backend” error?
- Seaborn Lineplot Module Object Has No Attribute ‘Lineplot’
- IndexError: index 2 is out of bounds for axis 0 with size 2
- Superscript in Python plots
- IPython, “name ‘plt’ not defined”
- Pandas dataframe groupby plot
- How do I tell Matplotlib to create a second (new) plot, then later plot on the old one?
- TypeError: zip argument #2 must support iteration
- numpy/scipy/ipython:Failed to interpret file as a pickle