Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to import wx.lib.plot #565

Open
tritemio opened this issue Dec 2, 2015 · 2 comments
Open

Fail to import wx.lib.plot #565

tritemio opened this issue Dec 2, 2015 · 2 comments

Comments

@tritemio
Copy link

tritemio commented Dec 2, 2015

In up-to-date anaconda python 2.7 environment under Windows x64, I get an error when importing wx.lib.plot. The error says numpy is not found, but as you can see below it is installed:

Python 2.7.10 |Continuum Analytics, Inc.| (default, Dec  1 2015, 11:29:38) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import numpy; numpy.__version__
Out[1]: '1.10.1'

In [2]: import wx

In [3]: import wx.lib.plot as plot
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-865c1dd4bc1f> in <module>()
----> 1 import wx.lib.plot as plot

C:\Users\laser2002j\Miniconda3\envs\py27\lib\site-packages\wx-3.0-msw\wx\lib\plot.py in <module>()
    124     (http://numpy.scipy.org) for information on downloading source or
    125     binaries."""
--> 126     raise ImportError, "NumPy not found.\n" + msg
    127
    128

ImportError: NumPy not found.

    This module requires the NumPy module, which could not be
    imported.  It probably is not installed (it's not part of the
    standard Python distribution). See the Numeric Python site
    (http://numpy.scipy.org) for information on downloading source or
    binaries.

In [4]:
@tritemio
Copy link
Author

tritemio commented Dec 2, 2015

The error happens because wxpython uses numpy.oldnumeric which has been removed in numpy 1.9:

# Needs NumPy
try:
    import numpy.oldnumeric as _Numeric
except:
    msg= """
    This module requires the NumPy module, which could not be
    imported.  It probably is not installed (it's not part of the
    standard Python distribution). See the Numeric Python site
    (http://numpy.scipy.org) for information on downloading source or
    binaries."""
    raise ImportError, "NumPy not found.\n" + msg

Installing numpy 1.8 fixes the error.

@tritemio
Copy link
Author

tritemio commented Dec 3, 2015

This is a known issue in earlier versions of wxpython:

http://trac.wxwidgets.org/ticket/16590

Anaconda ships wxpython 3.0.0. The latest version 3.0.2 (released on October 2014) has a fix for this problem. The package in Anaconda needs to be updated or otherwise should depend on numpy=1.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant