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