How to setup matplotlib in linux server?

MichaelBalack
MichaelBalack used Ask the Experts™
on
This is referring to the smem of url > https://www.selenic.com/smem/. We have already downloaded the smem (.tar.gz), and unzip them in /root/smem-1.4. smem is working now. However, if you want have the figures in pie chart(as shown in the url), you need to setup "matplotlab".

We already downloaded the matplotlib-3.0.0.tar.gz, and unzip to /root/matplotlib-3.0.0 folder. Please see the list of files as below,

INSTALL.rst
LICENSE
MANIFEST.in
PKG-INFO
README.rst
doc
examples
extern
lib
matplotlibrc.template
pytest.ini
setup.cfg.template
setup.py
setupext.py
src

BTW, how to setup this matplotlib on the server?

Thanks in advance.
tests.py
tools
tutorials
versioneer.py
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
MichaelBalackSenior System Engineer

Author

Commented:
Hi all,

lib, tools, doc, examples, src, tutorials, LICENSE, and extern are folders
On Redhat Linux you can run below command

# yum -y install python-matplotlib

Check Python, NumPy, libpng and FreeType dependencies are installed before hand.

https://matplotlib.org/users/installing.html
David FavorFractional CTO
Distinguished Expert 2018

Commented:
If you're using Ubuntu/Debian, you can simply do this...

apt-get install smem

Open in new window


Which will install smem + all dependencies.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

nociSoftware Engineer
Distinguished Expert 2018

Commented:
if pip is supported on your platform you could try pip install python-matplotlib
See also:
https://pythonspot.com/matplotlib/
Hi,

alternatively you can install Matplotlib and its dependencies as wheel packages

python -m pip install -U pip
python -m pip install -U matplotlib

Open in new window


Cheers
MichaelBalackSenior System Engineer

Author

Commented:
Hi Myousufali and David,

This is using SuSE Linux Enterprise 11 with SP4.

Hi noci,

Think pip is not support.

Hi dfke,

Attempt to run any one of the commands suggested result in error,

/usr/bin/python: No module named pip
MichaelBalackSenior System Engineer

Author

Commented:
Hi all,

Python version is, 2.6.9-31.1
Hi,

you need to install pip first then:

curl -O https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz
tar xvfz pip-1.2.1.tar.gz
cd pip-1.2.1
zypper install python-setuptools
python setup.py install
ln -sfn /usr/local/bin/pip /usr/bin/pip
pip install --upgrade awscli
cd ..

Open in new window

Cheers
David FavorFractional CTO
Distinguished Expert 2018

Commented:
While dkfe's suggestion is correct, about how to install pip, better to install pip + all packages via the package manager.

This allows you to do simple upgrades, via the package manager, to pull in bug fixes + security fixes + performance enhancements.

Remember, anything you build from source, you must continually monitor each project you build + rebuild it anytime the code becomes hackable.

So, since your using SUSE, you'll use SUSE Zypper to install all your packages. I only use Ubuntu, so I'm unfamiliar with exact syntax, so refer to link.

And likely Zypper provides dependency management, so when you install one package, then any dependencies like pip, are installed for you.
Software Engineer
Distinguished Expert 2018
Commented:
There is this:   https://software.opensuse.org/package/python-pip
Also there are quite some matplot lib packages: https://software.opensuse.org/search?utf8=%E2%9C%93&q=python-matplot

Now openSuse might be different from Suse..., can't opensuse modules be used on Suse?  (like Fedora on Redhat?)
MichaelBalackSenior System Engineer

Author

Commented:
Found expert - noci's suggestion is good.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial