我在ubuntu 18.04上使用pycharm编译py项目时遇到问题

时间:2020-05-03 01:52:03

标签: python linux ubuntu

这是我的代码:

    import math

q = input(print("enter the q"))
R = input(print("enter the R"))
n = 1
m = 1
dofpar = 2 * math.sin(m * 3.14159 / n)
U = (q ** 2 / (4 * 3.14159 * 8.8 * 10 ** (-12) * R)) * dofpar
for n in range(2, N):
    for m in range(1, n - 1):
        dofpar += 2 * math.sin(m * 3.14159 / n)
print(U)

这是我每次尝试编译时都会遇到的错误:

/home/mohammad/PycharmProjects/untitled4/venv/bin/python /home/mohammad/PycharmProjects/p61h
/home/mohammad/PycharmProjects/untitled4/venv/bin/python: can't find '__main__' module in '/home/mohammad/PycharmProjects/p61h'

Process finished with exit code 1

1 个答案:

答案 0 :(得分:0)

似乎Python解释器在编译代码时面临挑战,请确保在系统中设置了正确的Python3路径,而不是Python2。 Refer here