Numpy has mysteriously stopped working
NickName:r12 Ask DateTime:2015-06-11T09:45:35

Numpy has mysteriously stopped working

I was trying to get this ConvexHull function running, and I needed numpy (I think) to get it to work. I'm going to try to get numpy uninstalled and reinstalled, but I'm not sure why/how this happened so that I can prevent it from happening again.

While I was running through some of the examples, I decided to stop running from the prompt to save some typing. When I ran the seemingly same bits of code from a file, it returned the following error message:

>>> 
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 2218, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Python34/numpy.py", line 1, in <module>
    from scipy.spatial import ConvexHull
  File "C:\Python34\lib\site-packages\scipy\__init__.py", line 61, in <module>
    from numpy import show_config as show_numpy_config
  File "C:/Python34\numpy.py", line 1, in <module>
    from scipy.spatial import ConvexHull
  File "C:\Python34\lib\site-packages\scipy\spatial\__init__.py", line 90, in <module>
    from .kdtree import *
  File "C:\Python34\lib\site-packages\scipy\spatial\kdtree.py", line 8, in <module>
    import scipy.sparse
  File "C:\Python34\lib\site-packages\scipy\sparse\__init__.py", line 212, in <module>
    from .base import *
  File "C:\Python34\lib\site-packages\scipy\sparse\base.py", line 11, in <module>
    from scipy._lib.six import xrange
  File "C:\Python34\lib\site-packages\scipy\_lib\__init__.py", line 14, in <module>
    from numpy.testing import Tester
ImportError: No module named 'numpy.testing'; 'numpy' is not a package
>>> ================================ RESTART ================================

Now, when I type import numpy from the prompt, it returns:

>>> import numpy
Traceback (most recent call last):
  File "<pyshell#40>", line 1, in <module>
    import numpy
  File "C:/Python34\numpy.py", line 1, in <module>
    from scipy.spatial import ConvexHull
  File "C:\Python34\lib\site-packages\scipy\__init__.py", line 61, in <module>
    from numpy import show_config as show_numpy_config
ImportError: cannot import name 'show_config'

The entire setup was running without issue a few minutes ago, and I am unsure exactly why this all stopped.

The full text of my commands is here. The file was short, C:\Python34\numpy.py with the following contents:

from scipy.spatial import ConvexHull
import numpy as np
points = np.random.rand(30,2)

Copyright Notice:Content Author:「r12」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30770221/numpy-has-mysteriously-stopped-working

More about “Numpy has mysteriously stopped working” related questions

Numpy has mysteriously stopped working

I was trying to get this ConvexHull function running, and I needed numpy (I think) to get it to work. I'm going to try to get numpy uninstalled and reinstalled, but I'm not sure why/how this happe...

Show Detail

Why has my numpy correlation code stopped working?

np.corrcoef has stopped working. It worked until a few hours ago then mysteriously stopped working. I tried converting all numbers to floats, then all numbers to int, but still np.corrcoef does no...

Show Detail

PHP DOMXPath has mysteriously stopped working

For some reason that completely escapes me, PHP DOMXPath has stopped working on my machine. As the painfully-trivial example below shows, even obvious cases aren't returning expected results. As yo...

Show Detail

HBase export task mysteriously stopped logging to output file

I recently attempted to do an export of a table from an HBase instance using a 10 data node Hadoop cluster. The command line looked like the following: nohup hbase org.apache.hadoop.hbase.mapreduce.

Show Detail

Mayavi has stopped working, crashes Python Jupyter notebook

I had installed Mayavi package in Anaconda Python on my Windows 7 machine. It was working until today. Today, it has stopped working, and crashes my Python Jupyter notebook. For example, the follow...

Show Detail

numpy suddenly stopped working on Raspberry

Week before perfectly working numpy stopped working under Python 3.7 on Raspbian GNU/Linux 10 (buster). Still works with Python 2.7. ~ $ python3 Python 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC ...

Show Detail

Pytthon.exe has stopped working

i have problem , when i try to run file .py with matplotlib ,suddenly show alert python.exe has stopped working and, this is my code : import scipy.io import numpy as np import matplotlib.pyplot...

Show Detail

AutoHotKey: SetTitleMatchMode mysteriously set to 1

Today in my master AutoHotKey script all the application-specific hotstrings and hotkeys mysteriously stopped working. After a lot of debugging, I discovered that SetTitleMatchMode had been set to ...

Show Detail

jScrollPane stopped working, and I can't see why

On this page: http://ally.alchemycs.com there is a box in the middle of the page labeled "Screenings" that has scrollbars. A while ago, I set up jScrollPane so that it had nice pretty scrollbars t...

Show Detail

Code has stopped working

I tested it at DEV C++ and Code Blocks , result was same. At console when I pressed Enter button than I saw "name has stopped working". #include &lt;cstdio&gt; #include &lt;cstdlib&gt; #include &lt;

Show Detail