Not able use installed modules

boB Stepp robertvstepp at gmail.com
Fri May 8 14:15:03 EDT 2020


On Fri, May 08, 2020 at 09:31:55AM -0600, Mats Wichmann wrote:
> On 5/6/20 10:15 PM, Music lover wrote:
> > Hello python team,
> >           I have installed the latest version of python from your site.
> > Then I successfully installed some modules like :- numpy , pandas,
> > matplotlib  from command prompt. But I am not able to use them while
> > programing in python Idle. It's saying " no module named 'matplotlib' ."

> As a general answer, this is *always* a problem with paths.  Your
> installation of modules went somewhere your Python doesn't know where to
> look, which is that Python's value of sys.path. It probably went into a
> version-specific location in the sys.path of a different Python as
> Souvik has suggested.
> 
> Usually if you ran "pip install something" and then can't find
> "something" that means pip does not map to the Python you're going to
> use.  As a result, it's better to use the following, with MYPYTHON being
> code for the way you expect to invoke Python - that could be "python" or
> "python3" or "py" or "py -3.8" or whatever it happens to be:
> 
> MYPYTHON -m pip install something
> 
> calling it as a module means things will be right for whatever MYPYTHON
> is, rather than picking up the first executable called pip, which might
> not be for that one.

This may be a naive question on my part, but, as far as I can tell, most
instructions that I have encountered for installing Python packages state the
installation instructions as "pip install ...", which seems to repeatedly
lead to these type of OP questions.  Has there ever been given thought to
changing these "standard" installation instructions to something less error
fraught for the newcomer/novice?

-- 
Wishing you only the best,

boB Stepp


More information about the Python-list mailing list