Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4619762
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:28:06+00:00 2026-05-22T02:28:06+00:00

Please forgive my simple question. I have just started to use Matplotlib and I

  • 0

Please forgive my simple question. I have just started to use Matplotlib and I am having some difficulty.

I can run the following with the interpretor without problems:

>>> from pylab import *  
>>> plot([1,2,3])  
>>> show()  

The above code generates a beautiful graph.

However, if I place the following code inside a file and run it, I get an error:

#!/usr/bin/env python
# encoding: utf-8

import sys
import os
from pylab import *

plot([1,2,3])
show()

Here is the error message:

Traceback (most recent call last):
  File "/Users/sbrown/Desktop/new1.py", line 12, in <module>
    from pylab import *
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/__init__.py", line 133, in <module>
    from matplotlib.rcsetup import (defaultParams,
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 19, in <module>
    from matplotlib.colors import is_color_like
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colors.py", line 54, in <module>
    import matplotlib.cbook as cbook
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/cbook.py",     line 15, in <module>
    import new
  File "/Users/sbrown/Desktop/new.py", line 2, in <module>
    plot([1,2,3])
NameError: name 'plot' is not defined
>>> 

Any idea what the problem could be? Thanks in advance for any help you can provide!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:28:06+00:00Added an answer on May 22, 2026 at 2:28 am

    Looks like you have a file on your Desktop that is shadowing the standard Python new module:

    >>> import new
    >>> new
    <module 'new' from '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/new.pyc'>
    

    Rename or remove $HOME/Desktop/new.py and try again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not exactly a lisp expert, so please forgive a fairly newbie question. I'm
I am very new at using Backbone. Please forgive me in advance as I
First please forgive me for total lack of understanding of Varnish. This is my
I have started practicing TDD approach. I am pretty much new to unit testing.
I am developing a project management application for in-house use. For storing project requirements,
I'm not too sure how to ask this question. I need to store a
Have been asked to print to a remote printer via a socket connection, and
I'm using Microsoft's idea for storing resource and booking information. In short, resources, such
I was trying to find a way to recognise a touch&hold on my buttons.
First I'm going to explain what I'm trying to do and then explain my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.