We help IT Professionals succeed at work.

How to setup matplotlib in linux server?

MichaelBalack
on
134 Views
Last Modified: 2019-02-20
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

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
CERTIFIED EXPERT
Distinguished Expert 2019

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.
nociSoftware Engineer
CERTIFIED EXPERT
Distinguished Expert 2019

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

Commented:
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
CERTIFIED EXPERT

Commented:
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
CERTIFIED EXPERT
Distinguished Expert 2019

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
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
MichaelBalackSenior System Engineer

Author

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