0

After installing numpy in PyCharm, how do you import it?.

After importing it and defining a function I got the error:

[enter image description here

alex
  • 6,818
  • 9
  • 52
  • 103
The Elif
  • 39
  • 1
  • 9
  • am a newbie to using pycharm.kindly help in the procedure of restarting – The Elif Nov 16 '17 at 07:13
  • I guess you need to install the library instead of running it, `pip install numpy`, the addresses in your error traceback... – DarkSuniuM Nov 16 '17 at 07:24
  • Possible duplicate of [Explain why numpy should not be imported from source directory](https://stackoverflow.com/questions/14570011/explain-why-numpy-should-not-be-imported-from-source-directory) – alex Mar 02 '18 at 20:16

2 Answers2

0

you should import numpy in the codes and usually rename it as np. add code below like this.

import numpy as np 
0

It took long to get to this solution first , create a virtual environment and then install package manager pip or pip3 there after you can comfortably : import numpy as np

The Elif
  • 39
  • 1
  • 9