unable to import numpy after pygame

Issue #277 resolved
Dmitry Marakasov
created an issue

FreeBSD 11.0, py-game 1.9.1, numpy 1.9.2:

$ python
Python 2.7.10 (default, Jul  3 2015, 20:22:17) 
[GCC 4.2.1 Compatible FreeBSD Clang 3.6.1 (tags/RELEASE_361/final 237755)] on freebsd11
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line 170, in <module>
    from . import add_newdocs
  File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 17, in <module>
    from . import scimath as emath
ImportError: cannot import name scimath

though

$ python
Python 2.7.10 (default, Jul  3 2015, 20:22:17) 
[GCC 4.2.1 Compatible FreeBSD Clang 3.6.1 (tags/RELEASE_361/final 237755)] on freebsd11
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import pygame
>>> 

I'm not a python pro, but seems like some kind of namespace conflict. This breaks endgame-singularity for instance.

Comments (5)

  1. Thomas Kluyver

    I am getting a similar error while testing pygame itself when it tries to load numpy:

      ...
      File "/«PKGBUILDDIR»/debian/python-pygame/usr/lib/python2.7/dist-packages/pygame/_numpysndarray.py", line 38, in <module>
        import numpy
      File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 180, in <module>
        from . import add_newdocs
      File "/usr/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 13, in <module>
        from numpy.lib import add_newdoc
      File "/usr/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 8, in <module>
        from .type_check import *
      File "/usr/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 11, in <module>
        import numpy.core.numeric as _nx
      File "/usr/lib/python2.7/dist-packages/numpy/core/__init__.py", line 14, in <module>
        from . import multiarray
    ImportError: cannot import name multiarray
    
  2. Thomas Kluyver

    If the original issue had the same cause as the one I saw (pygame's bundled copy of unittest), it was fixed by pull request #55 and pull request #63. So I'm closing this issue - maybe being optimistic, but we can reopen it if someone still sees the problem, and hopefully the simplification around numpy/numeric will make bugs easier to find.

  3. Log in to comment