4
votes

We upgraded to Mac OCX El Capitan and now PyCharm 3.4 seems to no longer recognize the sys module in Python 2.7: if we add an "import sys" line to our code, PyCharm puts a red line beneath it with the error "no module named sys."

The sys module is on the system. If we go to Terminal and launch the python CLI, import sys works as a command.

However, if we go to Project Interpreter settings in PyCharm, there appears to be no module simply named "sys" to import. Searching on "sys" modules and PyCharm gives so many unrelated results it is unclear how to find directions to fix this.

How do we get PyCharm to recognize the sys module?

1
Can you update PyCharm? I am using 2016.1.3 and just made the El Cap upgrade myself. I am not having this problem.andrew

1 Answers

2
votes

You need to assign, or change, the "Project interpreter".

File -> Default Settings -> Default Project -> Project Interpreter -> Then use the dropdown to pick the appropriate interpreter, or the cog to add one so you can pick it).

enter image description here