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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Reposting as an answer:
The problem is likely that your IDE is not setting up
sys.pathcorrectly. Find whereptyis imported from, and make sure that’s on your PYTHONPATH in your IDE’s settings.