[wingide-users] Problem with "pandas" on Mac OS X Lion
support at wingware.com
Wed Feb 5 12:26:01 EST 2014
Trevor T wrote:
> As a long-time Wing fan, I have been struggling lately how to solve an
> issue I keep having when trying to import the "pandas" module (
> http://pandas.pydata.org/ ) in either the Python shell or my projects
> on my Max OS X Lion machine.
> This is what a typical import in the shell looks like:
> import pandas
> cannot import name hashtableTraceback (most recent call last):
> line 1, in <module>
> # Used internally for debug sandbox under external interpreter
> line 16, in <module>
> from . import hashtable, tslib, lib
> ImportError: cannot import name hashtable
> The strange thing is that this error only occurs within WingIDE. If I
> open up a terminal, launch Python, and then import pandas - everything
> works smoothly and no error occurs.
> Now after some Googling, I'm not the first to run into this error but
> it appears I am the first to run into it within Wing. Here is a
> StackOverflow thread describing the problem: http://dr.tl/0e180 - the
> thing is they seem to have been having the problem within plain old
> python, instead of just Wing, and it was resolved by just changing the
> directory from the pandas source directory. To my knowledge, I'm not
> in the pandas source directory within the default python shell in Wing
> or any of my projects. So I'm not sure how this relates to the Wing
> Now admittedly, I haven't compiled pandas myself, and instead am
> relying on other composite packages. I have tested both "anaconda"
> and "ScipySuperPack" with the same results.
> Any ideas? Any help would be more than appreciated.
Try comparing sys.path and os.getcwd() in the two cases (inside and not
inside Wing). Most relevant would be whether '.' is in sys.path, and/or
you need to set the Initial Directory under the Debug/Execute tab in
Project Properties. If you need to alter Python Path you can also do
that in the same dialog under the Environment tab.
My guess from the SO item you reference is that you may just need to set
the Initial Directory property in Wing.
Wingware | Python IDE
Advancing Software Development
More information about the wingide-users