To make matplotlib in OSX work in a virtual environment, we can first create a virtual environment and then activate that created environment. Thereafter, install all the dependencies in that virtual environment.
Steps
- Open ubuntu terminal.
- apt-get install python-venv
- python -m venv <name of virtualenv>
- source <name of virtualenv>/bin/activate