Skip to content

Matplotlib works with python 2.7 but No module named in python 3.6 #15259

@zillurbmb51

Description

@zillurbmb51

Hello, I am using centos7. I have both python 2.7 and 3.6 installed. Matplotlib is fine with python 2.7 but in python 3.6 it shows No module named 'matplotlib' I have tried uninstall and reinstall with pip3 but nothing works. I have tried all the possible ways... Any Help?
(base) [zillur@dutillab hail]$ sudo yum install python-matplotlib
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

  • base: mirror.mojohost.com
  • centos-sclo-rh: repos-tx.psychz.net
  • centos-sclo-sclo: centos.vwtonline.net
  • elrepo: mirror.pit.teraswitch.com
  • epel: epel.mirror.constant.com
  • extras: mirror.millry.co
  • updates: mirror.wdc1.us.leaseweb.net
    Package python-matplotlib-1.2.0-15.el7.x86_64 already installed and latest version
    Nothing to do

(base) [zillur@dutillab hail]$ pip uninstall matplotlib
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Uninstalling matplotlib-2.2.3:
  Would remove:
    /shire/anaconda2/lib/python2.7/site-packages/matplotlib
    /shire/anaconda2/lib/python2.7/site-packages/matplotlib-2.2.3-py2.7.egg-info
    /shire/anaconda2/lib/python2.7/site-packages/pylab.py
Proceed (y/n)? y
  Successfully uninstalled matplotlib-2.2.3
```
```
```
(base) [zillur@dutillab hail]$ sudo pip3 install matplotlib
[sudo] password for zillur: 
Requirement already satisfied: matplotlib in /root/.local/lib/python3.6/site-packages (3.1.1)
Requirement already satisfied: cycler>=0.10 in /root/.local/lib/python3.6/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /root/.local/lib/python3.6/site-packages (from matplotlib) (1.1.0)
Requirement already satisfied: numpy>=1.11 in /usr/lib64/python3.6/site-packages (from matplotlib) (1.17.2)
Requirement already satisfied: python-dateutil>=2.1 in /usr/lib/python3.6/site-packages (from matplotlib) (2.8.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/lib/python3.6/site-packages (from matplotlib) (2.4.2)
Requirement already satisfied: six in /usr/lib/python3.6/site-packages (from cycler>=0.10->matplotlib) (1.12.0)
Requirement already satisfied: setuptools in /usr/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib) (39.0.1)
(base) [zillur@dutillab hail]$ python3.6 -c 'import matplotlib.pyplot as plt'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'matplotlib'


(base) [zillur@dutillab hail]$ sudo python3.6 -m pip install -U matplotlib
[sudo] password for zillur:
Requirement already up-to-date: matplotlib in /root/.local/lib/python3.6/site-packages (3.1.1)
Requirement already satisfied, skipping upgrade: cycler>=0.10 in /root/.local/lib/python3.6/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in /root/.local/lib/python3.6/site-packages (from matplotlib) (1.1.0)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in /usr/lib/python3.6/site-packages (from matplotlib) (2.8.0)
Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/lib/python3.6/site-packages (from matplotlib) (2.4.2)
Requirement already satisfied, skipping upgrade: numpy>=1.11 in /usr/lib64/python3.6/site-packages (from matplotlib) (1.17.2)
Requirement already satisfied, skipping upgrade: six in /usr/lib/python3.6/site-packages (from cycler>=0.10->matplotlib) (1.12.0)
Requirement already satisfied, skipping upgrade: setuptools in /usr/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib) (39.0.1)
(base) [zillur@dutillab hail]$ python3.6 -c 'import matplotlib.pyplot as plt'
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'matplotlib


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions