0

I am getting an error when I am trying to test the installation onnx as :

(base) C:\Users\skoppuravuri>python -c "import onnx"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\skoppuravuri\AppData\Local\Continuum\anaconda3\lib\site-packages\onnx\__init__.py", line 10, in <module>
    import onnx.helper  # noqa
  File "C:\Users\skoppuravuri\AppData\Local\Continuum\anaconda3\lib\site-packages\onnx\helper.py", line 16, in <module>
    from onnx import mapping
  File "C:\Users\skoppuravuri\AppData\Local\Continuum\anaconda3\lib\site-packages\onnx\mapping.py", line 10, in <module>
    TensorProto.FLOAT: np.dtype('float32'),
AttributeError: module 'numpy' has no attribute 'dtype'

I have also seen some solutions online but they aren't working properly. How do I overcome it?

Thankyou

desertnaut
  • 57,590
  • 26
  • 140
  • 166
sai
  • 91
  • 1
  • 11
  • 1
    You have probably called your test program `numpy.py`. That masks the real `numpy` module. Delete it and save it under a new name. – BoarGules Apr 03 '19 at 11:43
  • What is the location of that duplicate numpy.py? Will it be created in any module? – sai Apr 09 '19 at 08:49
  • Without knowing what is on your `pythonpath` I can't suggest an answer. Try searching your C: drive for `numpy.py`. – BoarGules Apr 09 '19 at 13:08

0 Answers0