-1

I have a python script which runs perfectly on OSX. After installing python, numpy and matplotlib on windows I cannot understand why the same does not run on windows.

Do you have any idea?

import numpy
from Tkinter import *
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure

# main App class
class App:
    def __init__(self, master):
        # Create a container
        frame = Frame(master)
        frame.pack()    


root = Tk()
app = App(root)
root.mainloop()

This is the error I get in windows

this is the error

After installing dateutil I have a new error

new error

I intalled also pyparsing, and now getting the error that I miss the six package, but I don't have any idea how to install that now.

Nicholas
  • 1,915
  • 31
  • 55
  • 3
    It will be helpful if you add some more detail, like what do you mean by not working? Does it throw some error? – vidit Aug 03 '14 at 07:59
  • yep you are right sorry. I'm adding that right now – Nicholas Aug 03 '14 at 08:02
  • 1
    Also, did you install the same versions of Python, numpy, etc.? For example, one of many reasons this code might not run is if you tried it in Python 3.x instead of 2.x. – abarnert Aug 03 '14 at 08:03
  • @abarnert I installed both python 2.7. To be honest in OSX I have XCode so numpy and matplotlib have been already on my machine. Whereas in windows I had to install everything from scrach :( – Nicholas Aug 03 '14 at 08:06
  • The version of numpy that Apple installs is pretty old (at least as of OS X 10.9/Xcode 5), but if you're happy with it (and since it's not related to your current problem, you probably are), that's fine. – abarnert Aug 03 '14 at 08:26
  • @abarnert my application is quite simple I don't need the latest version of everything. It's just made of 10 UI widgets and a canvas. – Nicholas Aug 03 '14 at 08:34

1 Answers1

2

It looks like you need to install dateutil on the windows machine. It used to come bundled with matplotlib but you now need to install it.

Does

 import dateutil

throw an error?

There's a list of dependencies here: http://matplotlib.org/users/installing.html which include dateutil, which seems to be working now, and pyparsing which seems to still be missing.

Mark
  • 90,562
  • 7
  • 108
  • 148
  • yes it gave me an error but I install them using http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-dateutil provided in this thread: http://stackoverflow.com/questions/879156/how-to-install-python-dateutil-on-windows But I have a new error that I add above – Nicholas Aug 03 '14 at 08:27
  • 1
    @Nicholas: You need to learn to read error messages, or at least glance at them. If the first one said you needed `dateutil`, and you fixed it by installing `dateutil`, and the new one says you need `pyparsing`, what do you think will fix it? – abarnert Aug 03 '14 at 08:30
  • 1
    @Nicholas: OK, so if it says you need the `six` package, what do you think you need to install to fix that? There's a package named `six` on Gohlke's archive, and on PyPI, and anywhere else you look. Seriously, if you need people to walk you through each step of this, you're never going to get anything done. – abarnert Aug 03 '14 at 08:35
  • 1
    Check the link in the edited comment. Looks like you're almost there. The link also has info on Enthought Python, which might be worth checking out. – Mark Aug 03 '14 at 08:35