0

I am sorry for asking this question again, but I could not find any answer to my problem that helped me. I don't have much experience with python. I use python version 3.6.8 on Windows and I have already installed matplotlib, numpy and scipy. The 'pylab.py' file is also contained in the matplotlib folder. Edit: Using matplotlib.pyplot also doesn't work.

Edit: After some more trials I got the error that the module 'six.names" could not be found. The six package has been installed.

import pylab
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pylab
ModuleNotFoundError: No module named 'pylab'
 import matplotlib.pyplot
Traceback (most recent call last):
  File "<pyshell#21>", line 1, in <module>
    import matplotlib.pyplot
  File "C:\...\Python36-32\lib\matplotlib\pyplot.py", line 30, in <module>
    from cycler import cycler
  File "C:\...\Python36-32\lib\cycler\cycler.py", line 48, in <module>
    from six.moves import zip, reduce
ModuleNotFoundError: No module named 'six.moves'
leoneill
  • 11
  • 1
  • Not sure why the downvote. Sure it's a newbie question, but it is a good newbie question (all steps to reproduce the problem, the full exception stack trace, and some version information). – Leporello May 22 '19 at 15:37
  • How did u installed pylab? What command? – Tech at The Sparks Foundation May 22 '19 at 18:04
  • I installed only matplotlib, using Anaconda and the command ```conda install matplotlib``` – leoneill May 22 '19 at 18:44
  • The new problem you have met is entirely different from the original question (it is about package dependencies and Anaconda handling of such). You should consider asking a new question. – Leporello May 23 '19 at 08:55

1 Answers1

1

Per https://matplotlib.org/faq/usage_faq.html#matplotlib-pyplot-and-pylab-how-are-they-related, pylab is not recommended; you should use pyplot instead.

The correct way to import either is

import matplotlib.pyplot  # use this
import matplotlib.pylab  # only if you cannot avoid it

(pyplot and pylab are not standalone modules, but submodules of matplotlib.)

Leporello
  • 638
  • 4
  • 12