What is the simplest way to make Matplotlib in OSX work in a virtual environment?

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.


  • Open ubuntu terminal.
  • apt-get install python-venv
  • python -m venv <name of virtualenv>
  • source <name of virtualenv>/bin/activate