How to fix or properly import the modules in PyCharm?

I want to install matplotlib and numpy. I have manikonda. Tried using the built-in PyCharm download and install pip and conda install.
import matplotlib
x = linspace(0, 5, 10)
y = x ** 2
print(x)
print(y)


Outputs:
File "C:/Users/PsyhoGhost/Desktop/1/matplotlib.py", line 1, in
import matplotlib
File "C:\Users\PsyhoGhost\Desktop\1\matplotlib.py", line 2, in
x = linspace(0, 5, 10)
NameError: name 'linspace' is not defined

With numpy as well.

Thank you corrected yourself by creating a new project and installing these modules in the embedded loader PyCharm.
June 27th 19 at 15:25
1 answer
June 27th 19 at 15:27
Solution
import matplotlib
import numpy
x = numpy.linspace(0, 5, 10)
y = x ** 2
print(x)
print(y)
1e0aadd93da34fb8b63fbb0181c3f8cd.png - Angelina87 commented on June 27th 19 at 15:30
: answer updated - Sonny.Skiles commented on June 27th 19 at 15:33
:
import matplotlib
import numpy
x = numpy.linspace(0, 5, 10)
y = x ** 2
print(x)
print(y)
- Sonny.Skiles commented on June 27th 19 at 15:36
: 3923aca6581a4b99b36d6412f6567f68.png - Angelina87 commented on June 27th 19 at 15:39
: 04d53beb7584442799acb1b6b680356f.png - Angelina87 commented on June 27th 19 at 15:42
: Do not name your scripts with a module name, rename your matplotlib.py and numpy.py into something else. And then to find an article on the Internet about import in Python and read it completely. - alexandro_Auer commented on June 27th 19 at 15:45

Find more questions by tags PythonPyCharm