PyCharm: ImportError: No module named 'websocket'

I recently reinstalled pycharm and imported an old project that uses websockets. I have python interpreter (2.7) and added websocket module. There is a folder called "websocket" in the C: / Python27 / Lib / site-thes folder, and this path is in the list of paths that the interpreter uses.

There are no errors in the code, but when I run it I get "ImportError: No module named 'websocket'"

enter image description here

+3


source to share


1 answer


I recently had a similar problem and it took me a while to realize that the translator is just talking to Pycharm - it doesn't necessarily tell Pycharm what environment to work in.



Look in "Editing Configurations ..." (dropdown at the top right of Pycharm). If you set up your script there, make sure it has the same Python Interpreter as your settings. Usually the interpreter in your preferences is at the top of this list and is labeled "Default".

0


source







All Articles