Can't import pty module even though it's installed
Question
I have Python 2.7 installed on OpenSUSE. I'm using the pty
module to spawn some ptys:
import pty
But Python can't seem to find it.
ImportError: No module named pty
Running help('modules')
in the interpreter shows that pty
is installed.
Solution
Reposting as an answer:
The problem is likely that your IDE is not setting up sys.path
correctly. Find where pty
is imported from, and make sure that's on your PYTHONPATH in your IDE's settings.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow