PyCharm 下提示 'no module named time'

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PyCharm 下提示 'no module named time'相关的知识,希望对你有一定的参考价值。

因为没有在 PyCharm 的设置中指定 Python 解释器,在 File/DefaultSettings/Project Interpreter/Python Interpreter 中设置好就可以了。

详见:

http://stackoverflow.com/questions/10987834/importerror-no-module-named-cv2-when-running-django-project-from-pycharm-ide

I‘m not quite sure if this works for you guys but it works for me. In my case, it seems to me that I installed OpenCV to work with the default Python arriving with OS X. I remember I tried to install Python 2.7.5 and Python 3 in my Mac as well, I see them when I chose my Python interpreter for Pycharm. And all of them didn‘t let me import module cv2. So I change to the default Python2.7.2 (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python). Then, in File/DefaultSettings/Project Interpreter/Python Interpreter, click on the Python interpreter that‘s been added (Python 2.7.2), click on Paths and locate to "/usr/local/bin/python2.7/site-packages"and add it. Click the blue refresh button, apply and ok. Then it works, both with import and autocompletion. 

Regards

以上是关于PyCharm 下提示 'no module named time'的主要内容,如果未能解决你的问题,请参考以下文章

解决Pycharm中module 'pip' has no attribute 'main'的问题

PyCharm导入pymysql包运行报错问题解决:No module named 'PyMySQL'

python运行提示缺少模块 No module named 'XX'

pycharm中报错:ImportError: No module named 'skimage'

python中安装了pil库,但是编译的时候还是提示No module named 'PIL'

Pycharm问题:module 'pip' has no attribute 'main'