File: dependency_matplotlib.py

package info (click to toggle)
python-ase 3.17.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,340 kB
  • sloc: python: 117,348; makefile: 91
file content (30 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from __future__ import print_function
import sys

msg = "\nThe matplotlib python module is missing or not installed properly.\n"
msg += "Is the PYTHONPATH environment variable set correctly?\n"
msg += "Please verify your installation by running on the command line:\n"
msg += "python -c 'import matplotlib'\n"
msg += "\n"
msg += "This module is optional and required in order to use "
msg += "ASE's simple GUI.\n"
msg += "If you don't wish to use ASE's GUI ignore this error, otherwise\n"
msg += "please install the package using "
msg += "your distribution package manager, i.e.:\n"
msg += "\n"
msg += "  Debian/Ubuntu: sudo apt-get python-matplotlib\n"
msg += "\n"
msg += "  OpenSUSE: yast -i python-matplotlib\n"
msg += "\n"
msg += "  Red Hat/Fedora: yum install python-matplotlib\n"
msg += "\n"
msg += "or perform manual installation, preferably as non-root user,\n"
msg += "following http://matplotlib.sourceforge.net/users/installing.html."

if locals().get('display'):
    try:
        import matplotlib
        matplotlib  # silence pyflakes
    except ImportError:
        print(msg, file=sys.stderr)
        raise