PyCharm 找不到模块 'math'
PyCharm can't find module 'math'
我的环境PyCharm4.5 和Python3.5
可以运行成功,但是提示找不到模块math
,无法完成方法提示
我试过这个:
import imp
imp.find_module('math')
(<_io.BufferedReader name='/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload/math.cpython-35m-darwin.so'>, '/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload/math.cpython-35m-darwin.so', ('.cpython-35m-darwin.so', 'rb', 3))
我是Python的新手,我认为这不是math.py
。我该如何解决?
As a side-note, I'm more than willing to believe that this is the math module that you are seeking, since math is built-in.
是的,Python 3.5 没有 'math.py',它是 'math.cpython-35m-darwin.so'
我切换到Python 3.4.3,没问题。
PyCharm 4.X 不完全支持 Python 3.5。
更新到 PyCharm 5,您的问题就会消失。
我的环境PyCharm4.5 和Python3.5
可以运行成功,但是提示找不到模块math
,无法完成方法提示
我试过这个:
import imp
imp.find_module('math')
(<_io.BufferedReader name='/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload/math.cpython-35m-darwin.so'>, '/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload/math.cpython-35m-darwin.so', ('.cpython-35m-darwin.so', 'rb', 3))
我是Python的新手,我认为这不是math.py
。我该如何解决?
As a side-note, I'm more than willing to believe that this is the math module that you are seeking, since math is built-in.
是的,Python 3.5 没有 'math.py',它是 'math.cpython-35m-darwin.so'
我切换到Python 3.4.3,没问题。
PyCharm 4.X 不完全支持 Python 3.5。 更新到 PyCharm 5,您的问题就会消失。